Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm just wondering, what is the best practice in following situation:
- workstation - Windows
- development machine - Debian
- mail machine - Debian
- production server - CentOS

  1. Use single private key to authenticate on all machines?
  2. Use single key per machine?

Does the first way have any security implications?

share|improve this question
FWIW, I use two keys Chris@Home and Chris@Work; the private keys only reside at the corresponding locations. – Chris S May 1 '12 at 2:22

SSH keys are just like physical keys. In some situations it makes sense to have a single common key for all locks. Other times it doesn't. Only you make make that assessment for your particular situation.

share|improve this answer

It depends. Considering you can protect the private key with a password, if you use a strong enough password and protect the private key, then using the same key with all machines can work just fine. On the other hand, I usually use a number of unique keys for systems in the same risk category. For example, I use a key for a production server that I store on an encrypted USB drive. I use a different key for dev and test machines. Further, I don't use ssh keys to grant root access but rather access to my account.

The security implications for first method is that if the key is compromised (i.e. adversary gain access to both the key and password), then the adversary could have remote access to all systems. Since privilege escalation is much easier with any sort of system access, there's greater risk with option 1 than with option 2. However, option 2 only offers better security/lower risk if you protect the password and private key.

share|improve this answer

I'd generate a key on each of the windows workstation and debian development machine. Use passphrases. Publish the keys to the Debian machines and the CentOS production server.

The putty key tool "PuTTYgen can also export private keys in OpenSSH format and in format. To do so, select one of the ‘Export’ options from the ‘Conversions’ menu. Exporting a key works exactly like saving it (see section 8.2.8) - you need to have typed your passphrase in beforehand, and you will be warned if you are about to save a key without a passphrase."

share|improve this answer

Go with #1. The added complexity of #2 adds very few benefits (especially if you encrypt your private key with a strong passphrase).

Additionally, I should note that I always recommend encrypting your private key, and each machine you connect from should have its own keypair. That way, if one of your workstations gets compromised, lost, etc., you can just yank that machine's public key from your servers and it won't disrupt access from the rest of your workstations.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.