Renewing AWS EC-2 Key-Pair

In this post i will explain how easy it is to renew / add new AWS EC-2 instance key pair. So let’s start

Requirements:

You must be able to login to EC-2 instance from your PC terminal. This article is not for you in case you have lost your existing key-pair

Step No. 1 Creating new Key-pair

Login to your Amazon Console and Click on EC-2

Once clicked, Scroll down and you will find Key-pairs under Network & Security Section as shown below

Click on Key Pairs and you will see a window similar to below. Give Name to your Key Pair and Click “Create Key Pair”

Once you click the Create Key Pair, it will Download to your system.

Change the permission of the key pair

salman@Red-Dragon:~/Pictures/AWS$ chmod 400 tekco-key-omen.pem

Now retrieve the public part from your Key-pair and copy it as shown below.

Now Connect with your EC-2 instance with your old key

Now edit the authorized_keys file as show below:

Paste the public key which you retrieved earlier in authorized_keys file as show below

Save and exit and Now from your PC connect the EC2 instance with your new Key-Pair

Perfect. We have successfully entered our EC-2 instance with our New Key-Pair. Once you are satisfied, you can delete the old key from authorized_keys and start using the new one.

Thank you.

Salman A. Francis
https://www.youtube.com/linuxking

Leave a Reply

Your email address will not be published. Required fields are marked *

Impact Financial

Good draw knew bred ham busy his hour. Ask agreed answer rather joy nature admire wisdom.

Latest Posts

  • All Posts
  • Amazon
  • Amazon EFS
  • apache
  • AWS
  • aws backup
  • aws cli
  • aws cli version 2
  • aws sync
  • Banking
  • bash scripting
  • Budgeting
  • cloud
  • cyber attack
  • cyber scam
  • database
  • efs
  • Email
  • Email Client
  • Email Server
  • Insurance
  • Investing
  • Learning
  • lets encrypt
  • Linux
  • php
  • pip
  • postgresql
  • python
  • S3
  • s3 buckets
  • scam prevention
  • scams
  • security
  • ssl
  • Tax Strategies
  • Troubleshooting
  • website
  • wordpress
  • wordpress setup
    •   Back
    • Linux tips
    •   Back
    • nextcloud
    •   Back
    • Rainloop

Categories

Tags