For this example I am going to use EC2 t2.micro instance
while creating instance You’ll get option for key
→ either you generate on your own
→ or let the cloud service do it for you ✅
Example of creating new keypair for EC2
→ Key will be downloaded
For SSH
Open Terminal
Run following command
ssh -i (path to .pem ) ubuntu@ip address
for me it’ll be
ssh -i ./Downloads/key1.pem [email protected]
(ip will be changed after this blog is posted so no need to worry for me, so don’t try to use my ip)
but now you’ll be promoted to chose yes or no
type
yes
now you’ll be facing some error regarding file is too Open
so cd to the file
and run this command with your file name
chmod 600 key.pem
→ replace key with your file name
cd
ssh -i ./Downloads/key1.pem [email protected]
Initials will be changed with
ubuntu@ip…….
means you are successfully connected.
Get more at
Author: Manav Rajani
Blogs link : Accurate