When we create a new server in aws, it allows us to generate a key pair and attach it to the server. Now imagine you want to share access to this multiple people in your team, but you don’t want to share your private key. This is what you need to do.
- Generate new key for each member of your team or ask each member for there public keys
- Add it to the authorized_keys list in your servers
If you plan to generate key for each users, run the command
You share the
newuser file with your team member and then copy the contents of
Then login to your server and go to the folder
cd ~/.ssh, and open the file
authorized_keys in vim and add the contents of newuser.pub to the end of the file.
When you want to diable this user from accessing the server again, delete that line from your