1. From the AWS EC2 Console go to 'Key Pairs' and generate a new key pair (eg: NewKey.pem); Download the generated pem key, and chmod it to 0666 |
2. Use the new pem key to generate a public key |
$ ssh-keygen -y |
When prompted, enter the path to NewKey.pem. This will generate NewKey.pub |
Tip: Edit NewKey.pub and append the key's name so you can identify it easier in the next steps. |
Just append a single space, then a tag/name for the key |
3. Add the new public key to your instance |
$ cat NewKey.pub | ssh -i OriginalKey.pem user@amazon-instance 'cat >> .ssh/authorized_keys' |
4. Test the new key by logging in and removing the old/original key |
$ ssh -i NewKey.pem user@amazon-instance |
$ nano ~/.ssh/authorized_keys |
Find the line containing the 'original' key and remove it. |
This saved my day! Thank you. |
tnx |
Thank you so much, saved my day. Sep 06, 2019 What is Zoner Photo Studio. Zoner Photo Studio is a software application developed by the Czech-founded company Zoner Software. This bitmap editor and image file manager is one of the most widely used programs for editing digital photographs in its country of origin, and is also widely used around the world. Zoner photo studio x key generator. |