Reputation: 6110
Upvotes: 0
Views: 425
Reputation: 269921
When SSH is used to connect to a Linux computer, a private keypair is provided.
The Linux system will then check in the user's home directory for keys that are authorized to login. For example, if the user is ec2-user
, it will look in /home/ec2-user/.ssh/authorized_keys
.
If the matching public keypair is found, then the user is permitted to login.
Therefore, the recommended process is:
ssh-keygen
. They should keep the private keypair to themselves, but provide an Admin with the public keypair. This is done to ensure that nobody else has ever seen the private keypair (it's like a password).~/.ssh/authorized_keys
file. This could be a shared user like ec2-user
, or it could be a separate login for each user.authorized_keys
file.Since you have been using a shared keypair, you should remove that keypair immediately. Then, ask authorized users to create their own keypair, provide it to you, and then put them in the authorized_keys
file.
Upvotes: 2