Situation: One server with SSH daemon. Multiple clients with the user myUser which should connect to the server via SSH. With password based authentication everything is fine.

Now I would like to migrate to public key authentication. On workstation1 I generated a key (pair) and transfered the public key to the server utilizing ssh-copy-id. Public key authentication is working so far.

Now I checked /home/myUser/.ssh/authorized_keys on the server. There is only one key present associated with myUser@workstation1. There is also an association to myUser@workstation1 in /home/myUser/.ssh/id_rsa.pub on workstation1.

I want to connect to myUser@server from multiple clients (myUser@workstation1, myUser@workstation2 ... , myUser@workstationN).

  • Can I use the same key from all of those clients? Must I remove the clients name workstation1 from the key file or authorized_keys file? Does this have any security implications?

  • Or should I better generate a separate key for every workstation?


Yes, you can use the same key from each workstation. Your workstation's name is part of the comment attached to the key, and should not prevent you from copying the key to another machine and using it there.

When copying the key, people recommend that you do this via a secure mechanism such as a detachable USB drive. Just copying it directly over the network is subject to whatever limitations exist with that connection.

Further reading:

| improve this answer | |
  • When using flash media like an SSD or USB stick to copy a private key, encrypt the key first, like in an encrypted zip or truecrypt volume. When you delete the plain key, the key will still exist on the drive, only the listing is removed. – SPRBRN Jan 18 '16 at 10:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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