Passwordless login via SSH from multiple computers

sshssh-keys

I'm trying to understand the concept of passwordless login via SSH.
As far as I understand you create the SSH key pair on the computer on which you will connect FROM.
Then copy the public key to the server which you will connect TO.
So far so good? Correct me if I'm wrong on the basics…

I guess that would result in that the passwordless logins only can be made from my computer (where the key pair was created because thats where the private key exists).

But what if I want to be able to use passwordless logins from multiple computers to the same server?
Do you need to create a key pair on each computer that will connect to the server and copy each public key to the server?
How should I do?

Best Answer

You either follow that procedure for multiple machines or copy the private key. Depending on your personal security requirements and workflow one might be easier or "better" than the other.

If your private key is compromised you would need to remove it from the authorized_keys file and/or revoke it. In addition, depending on your workflow, you would need to enroll a new key for multiple machines. Having one key per machine would likely be more secure but also potentially more management overhead.

Related Question