Score:0

Can multiple keypairs added to an instance in aws?

bw flag

Regarding to this question here "https://serverfault.com/questions/221760/multiple-public-keys-for-one-user" and many others on getting ssh access using multiple pub keys for one user, can I somehow add multiple keypairs to the authorized_keys folder inside the instance for the same user?

So the user can access the instance using any authorized keypair he is allowed to use to connect to the instance.

We did try adding a keypair to authorized_keys folder but we couldn't access the instance using that keypair.

Score:0
bv flag

Yes u can use as many as u want, follow this step :

  1. download the new .pem you want to use

  2. from your local computer, read the public key from that new .pem

ssh-keygen -f new_pem_file.pem -y

  1. copy that public key printed out on your terminal

  2. go back to your server

ssh -i old_pem_file.pem username@ipaddress

  1. Edit the authorized_keys file on your server, and give one or two lines space and paste the copied RSA of new .pem file here, and then save the file.

sudo nano ~/.ssh/authorized_keys

  1. Finally try to connect to your server with the new .pem file.

Hope this answer can help :)

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.