How to connect an EC2 instance if you lost your keypair (.pem) file ? Recover AWS keypair

preview_player
Показать описание
This video is going to be about how to connect or access an EC2 instance in case you lost your private key or the .pem file or you accidentally deleted the file permanently.
What will we do in this video?
- We will Create a new EC2 Linux instance named ‘dev-stage-new’ with a keypair
- Then, we will Access the EC2 instance using the keypair
- Next, we will Delete the keypair (after that, we won’t have the keypair to access the ec2 instance)
- Again, we will Create a new ec2 instance named ‘dev-stage-old’ with a new keypair, and then
- Perform our lab task to access the old EC2 instance whose keypair is already lost or deleted.
So, let’s begin.
Рекомендации по теме
Комментарии
Автор

Thank you.
your tutorial just saved me from a huge trouble :)

noname-nsnh
Автор

This is awesome, God Almighty will continue to enrish your knowledge in the industry.

techfuture-code-tv
Автор

Thank you Enkripsan, it is straightforward and detailed.

kennethmenniboe
Автор

you just saved me from a big trouble
thank you

gktirkha
Автор

Hello, may be you don't know how much your video help me today. It was horrible experience when I accidentally delete the public key from ~/.ssh/authorized_keys and forgot to add the new one. It was locking out myself from the server. I was in huge trouble. Thank you very much from the bottom of my heart.

rudrakshya
Автор

Thank you so much sir
Thank you for worderful explaination

shravankumar
Автор

At 10:00, youve copied and cat keypair to the old volume but the question is what you have copied? if it the temporary instance's keypair youve copied to the old one ?

A.Sandeep-
Автор

Hi, the fstype i got is a ext4. when i use the command "mount -o rw, nouuid /dev/xvdf1 /mnt
" got error with "mount: /mnt: wrong fs type, bad option, bad superblock on /dev/xvdf1, missing codepage or helper program, or other error.
". May I know how to solve this? Thank you :)

Jaden
Автор

you should explain the " mount -o rw, nouuid " this command what it will do in detail rather that video is superb

saurabhfule
Автор

To attach and detach volume We don't have to stop the instanc, Right?

madhanops
Автор

You just nailed it, please tell me why did you rename it to xvda1 at last.

hassanmir
Автор

Why can't we just create a ami of that server with new key and make that instance live💀 just asking

rizwanhawaldar
Автор

what if the instance is running on windows?

progjr
Автор

I followed each and every step in linux not worked. Time waste.

durgaprasadandraju
Автор

hii sir at last step when i am going to attach volume it is not showing new instance how to rectify it .
please explain me .
it is showing same availability zones only displayed here.
how to fix this sir.

legend
Автор

Hello Team,

Y'day One interview attended

Question : I lost my key pair not sure where i saved but i want connect throw putty itself not in console #Connect ec2
You can take backup of image or snapshot to recover the instance back but #here #i #want #same #public #ip address how to recover my ip ? Plz team any one can provide link how to recover is that possiable ?
🔐🔑🔐🔑🔐🔑 ☝️☝️☝️

sureshk
Автор

THIS IS ONE METHOD - OK, PLEASE DO ANY ANOTHER METHOD FINDOUT PLEASE SHARE THE NEXT VIDEO AND ATTACHED TO NOTE BOOK POINTS- LIKE-


Concept Overview
Detail Demo
Steps on system:-
Check File system

lsblk -f


Create tempvolume for mounting
sudo mkdir /mnt/tempvol


Mount tempvolume [below one is for xfs filesystem]
sudo mount -t xfs -o nouuid /dev/xvdf1 /mnt/tempvol



Check Mounting
lsblk -f



copy authorized_keys to mounted volume
cp .ssh/authorized_keys


Check the content on new volume
ls -lah


umount the secondary volume
sudo umount /mnt/tempvol


FIND/NOTE THE OLD EC2 EBC-VOLUME ID, , AND EC2 - MACHINE -ID AND ROOT VOLUME ATTACHED TIME BECAREFULL USED THIS /dev/xvda

i-0daf83c2c139b56b2



Attached

rritsoftwaresolutions