简体   繁体   中英

Amazon Linux 2 User Creation with SSH Keys

I am trying to create some users with Amazon Linux 2 using adduser command but not able to create ssh files for login for those users.

If someone can help me out with the steps it would be really helpful

This is standard Linux. It is actually unrelated to the fact that you are using an Amazon EC2 instance.

In a typical organisation, users should generate their own keypairs and then provide the public half to the SysAdmins so they can put it in the ~/.ssh/authorized_keys file. This way, even the SysAdmins don't have the private half of the keypair.

See: How to use ssh-keygen to generate a new SSH key

Alternatively, users can generate a keypair in the Amazon EC2 console. The public keypair will be retained by AWS for launching future instances and the private keypair will be provided as a downloaded.pem file.

They can extract the public key from a private key with:

ssh-keygen -y -f key.pem > key.pub

See: Use RSA private key to generate public key?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM