2

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?

user63835
  • 374
  • 1
  • 4
  • 13

1 Answers1

2

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: