0

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.

1 Answers1

0

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 :)

Bona Ws
  • 101
  • 2