LAB – Moving a volume from one EC2 instance to the next issue

Dears,

can’t found ec2 instant pem file in Lab

1 Like

I’ve the same problem, it’s been 10 days but looks like nobody bothered to answer this question.

Which lab is this? Please post the link to it.

Hi

LAB – Moving a volume from one EC2 instance to the next

in provisioning the lab the key is there but after the provision it disappears, fortunately I manage to copy it before it disappears
Before lab provision


after

as I said earlier I manage to copy the key before the provision of the lab …after the provision I renamed the copied file to match the name “rdskeypair.pem” but when I open a new terminal the key is gone again, so I guess there is a script that remove any file with name “rdskeypair.pem” and that script is executed each time a terminal is being opened
for those who plan to copy the key before it disappears, name it anything else (not rdskeypair.pem)

I have encountered the same issue. The lab needs to be fixed.
LAB - Moving a volume from one EC2 instance to the next
COURSE - AWS Solutions Architect Associate Certification

I have checked this lab. I found the PEM file like this

~ on ☁️  (us-east-1) ➜  find / -type f -name '*.pem'
find: ‘/proc/tty/driver’: Permission denied
/usr/local/lib/python3.10/site-packages/pip/_vendor/certifi/cacert.pem
/usr/local/lib/python3.10/site-packages/botocore/cacert.pem
/home/rdskeypair.pem

It is /home/rdskeypair.pem

So it can be used thus

ssh -i /home/rdskeypair.pem [email protected]

where X.X.X.X is public IP of EC2 instance.

It did not disappear.

Please note also that when moving from instance1 to instance2

INCORRECT:

[ec2-user@ip-172-31-12-4 ~]$ ssh -i /home/rdskeypair.pem [email protected]
Warning: Identity file /home/rdskeypair.pem not accessible: No such file or directory.

Correct:

[ec2-user@ip-172-31-12-4 ~]$ exit
logout
Connection to 44.192.60.171 closed.

~ on ☁️  (us-east-1) ➜  ssh -i /home/rdskeypair.pem [email protected]
The authenticity of host '44.199.215.19 (44.199.215.19)' can't be established.

You must return to the lab terminal using exit or logout command before trying to SSH to another EC2 instance.

2 Likes

Thank you, Alistair.

Hey Alistair, can you please explain it a bit more detailed, whats wrong here? I tried to use that step to exit first, but it only says connection closed and the whole terminal gets frozen -.-

You exited from the wrong terminal

~ on ☁️  (us-east-1) ➜  

The above is the prompt for the lab terminal. Don’t exit from this or you close the lab!

You only exit to return to the lab terminal from some EC2 instance you entered via ssh command. EC2 instances have prompt like this

[ec2-user@ip-172-31-12-4 ~]$ 

Forgot to reply, thanks, yeah, your solution from post of Dec 23 worked well.