Skip to content

Instantly share code, notes, and snippets.

@rajucs
Created August 16, 2018 10:56
Show Gist options
  • Save rajucs/899d53242ab61937cb19a7e44b2a3609 to your computer and use it in GitHub Desktop.
Save rajucs/899d53242ab61937cb19a7e44b2a3609 to your computer and use it in GitHub Desktop.
1. Start new t1.micro EC2 instance, using new key pair. Make sure you create it in the same subnet, otherwise you will have to terminate the instance and create it again.
2. SSH to the new micro instance and copy content of ~/.ssh/authorized_keys somewhere on your computer.
3. Login to main instance with old ssh key.
4. Copy & replace the file content from point 2 to ~/.ssh/authorized_keys
5. Now you can login again only with new key. Old key will not work anymore.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment