AWS EC2 SSH key management | How to launch and SSH into EC2 instance with public & private key pair

preview_player
Показать описание
▬▬▬▬▬▬ * Instruction's Guides * ▬▬▬▬▬▬

In this lab session, we are going to launch and set up an EC2 instance on AWS. Along with that, we are going to create public and private key pairs for the EC2 instance so that we can SSH into an EC2 instance.

Typically there are two ways to generate the key-pair for an Ec2 instance on AWS -

1. Download the private key file(pem) from AWS itself at the time of launching an EC2 instance
2. Create your key pair(public key, private key) and associate those keys to launch the EC2 instance.

The first way is a little easy but you do not have very good control over the key generation. You have to rely on AWS to issue the key and use that key going forward. In case if you lose or misplace the key then it is impossible to SSH into your EC2 instance.

The Second is in which you can generate your key-pair(public, private keys) and add the public key to AWS manually by uploading it. And then use the private key to SSH into your EC2 instance. The only advantage which you have over here is you get complete control over the key generation part. Later on, you can use some secure channel to distribute the keys to other peer developers.

▬▬▬▬▬▬ ⭐️ 🕘Timestamps ⭐️ ▬▬▬▬▬▬
0:00 Intro
0:42 How to create a public key and private key for EC2 instance?
1:58 Part 1-Generate keys from AWS
4:51 Download the private key from AWS
7:26 Change the private file permission chmod 400
7:40 SSH into the EC2 instance
10:25 Part 2-Generate keys manually using ssh-keygen
13:29 Upload the public key to AWS
14:55 Launch EC2 instance with public key uploaded by us previously
17:04 SSH into the EC2 instance using the own private key

Disclaimer/Policy: All the content/instructions are solely mine. The source is completely open-source.

Video is copyrighted and can not be re-distributed on any platform.

#devops #aws #cloud #ec2 #ssh #keys
Рекомендации по теме
Комментарии
Автор

I was a bit skeptical before watching this since I needed a very quick explanation for work, but after watching a few short videos, I didn't find them helpful, and I reluctantly clicked on this. This video was very clear and helpful. I have subscribed and plan on returning to this channel if I need more guidance with AWS.
Thanks

abdurrahmanhabeeb
Автор

that climax moment when you have been working on something for so long and it just dont work and they the youtube tutorial makes it work. thank you Rahul

aminaabubakar
Автор

The best way of explanation. Your voice too clear.

kirankumarp
Автор

Thanks, greatly appreciate your sharing, helps so much especially when landing on Aws from more simple to use platforms like Digital ocean and 👍👍

gianluca_ruggieri
Автор

i search so many videos, but i dint get this much clear explanation, to creating our own private and public keys generating and, how to connect it to the server. its soooo clear. help full to me.

gkxrkqu
Автор

Best Explaination . Thanks and Much Appreciated !

AbhishekBudruk
Автор

very clear and concise explanation. way to to Rahul

roushanrishabh
Автор

Your video is very much appreciated, and helpful as well. Perhaps I may ask: How to change the key pair in any case is missing?

eddieGTL
Автор

Thanks for the video its very informative, however, I tried to run 'chmod 400' command on my local machine through 'cmd prompt' it says command not recognizable? Also, I am able to connect to ssh through my local machine but when you talk about 'terminal' are you using any other command prompt ?As even 'ls' command doesn't work on my local cmd.Please guide

zpihhwn
Автор

Thanks man very helpful . you just save me a lot of time here . I can just subscribe on your chanel

coubiss
Автор

Hi Rahul, I really want to start with AWS EC2. can you please make videos step by step. Regularly watching your videos on terraform and helm. very easy explanations. thanks

Mini-uwqe
Автор

Thank you 😊 for the tutorial, you explains everything very nicely. Please tell me, connecting MySQL client with RDS, this SSH key pair file helps in connectivity? Can you please make a video using private key for connecting database client with RDS. Hope I’m not missing anything. Many thanks.

ukaffairs
Автор

Good video. At one point you say that 'ubuntu@<someipaddress>' is your machine's IP address. A bit of nit. The first portion before @ is the userid. Numbers after @ sign are the actual IP address. AWS gives these default users such as 'ubuntu' for Ubuntu, 'ec2-user' for Amazon's Linux etc.

rahultino
Автор

what is the best practice that we should follow to save the private keys of all the ec2 instance securely ? how to securely share with colleagues of mine

srikanthreddy
Автор

its good Bro, but i was looking for something else, once after created the instances how do we use our own keypairs

nodetrafficsolution
Автор

Sir I have question
At a time of launch instance we download private key, that means public key have near ec2 instance. where do we search this public key in to ec2 instance?

hemantpharande
Автор

Hi Rahu,
l Why we have to use two keys (private and public)?
As I went through your video, you've logged in to ec2 machine thru public key and as well private key.
So, what is the difference that you thru with private key and public key?

venkateshreddy
Автор

Can I use the same key for multiple EC2 Instances?

faisalraj
Автор

sir i need help . i getting this massage . pls help me .
chmod: cannot access 'ubuntu1.pem': no such file or directory on aws

uinvestonline
Автор

Is keypair is region specific? If I have a launch ec2 in Mumbai region n I have download the key ...now I want to launch ec2 in N.virgina region so can I use same key ?

ashwinipurwat