SSH to EC2 Instances using Windows Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
okay so we are going to learn how to ssh into our ec2 instance using windows and for this we use say what is ssh well ssh to me is one of the most important function especially when you're dealt with amazon cloud it will basically allow you to control a machine remotely all using the command line okay and so what does it look like well basically we have our ec2 machine and it's running amazon linux 2 and it has a public ip and i don't know if you remember but we had an ssh security group on it and basically we allowed ssh on part 22 to any ip which basically allows our windows machine to connect over the internet directly into the machine and control it using the command line so we'll see how to do the requirements for parametrizing basically our windows and so we'll use putty to do ssh so this is a free tool available online and as you can see it's a little bit tricky to use the first time but we'll get used to it and we'll learn how to access session to window into it linux using putty so let's get started so i am in my windows machine and the first thing i'm going to do is download putty so google putty and take the first link and you can say you can download party here so i'll go ahead and download it and i'm under windows so you can choose whatever 64-bit or 32-bit installer i'll just use the 64-bit and run it then you may get a little warning when the thing runs to install but the installation process overall should go really smoothly so you go ahead and click on next next next again and yes so it goes ahead install putty and then we don't need to see the readme and we finish so the first thing you have to do is to go under windows scroll down and all the way to the bottom we see a patty folder and underneath we have patigen now using partygen we are going to convert the key we have downloaded from the ec2 console and we're going to convert it into a format that pati likes which is called ppk so we'll go and click on file and click on load private key now we need to go wherever you downloaded your private key so for me it's on my desktop click on the desktop and you need to open all files here is ec2 tutorial.pem and basically it says successfully imported foreign key okay and basically it says just use this key with putty you need to save private key command so the way i did it again is doing load and make sure to scroll down and click on all files to see the file that you just downloaded so here is our our key and it's imported and what i'll do is as they said click on the save private key here we get a warning saying are you sure you want to save this key without passwords to protect it yes for me this is fine i don't need passwords but if you want extra security you can say no and you can save with the passphrase so here on the desktop i will say ec2 tutorial and then you see dot ppk okay so this is a putty private key file we click on save and now we have done the conversion of our key from a pem file to a ppk file so we can close this and this is something we just have to do once now if we go back to windows and scroll down and look for putty one more time here is patty here we can now go ahead and open the program party and here is our patty program now we need to go ahead and basically enter the ip address of our ec2 machine so for this under my ec2 machine we see there is a ipv4 public ip and this is what we'll use so i'll just copy the public ip and paste this under hostname now we also need to add a username so i'll do ec2 minus user at the ap address ec2 user is basically the hostname we'll use to log into our ec2 instance now we can go ahead and save this and so i'll give it a name i'll call it my ec2 instance so we save it but we're not done yet so click on mice to instance obviously and we click on yes and so we get a little server host key is not caching the registry and then we get an error saying no supported authentication method available because we haven't linked our private key file so if you get that error you can close this we go back to putty and i'd like to show you errors before i show you how things work because these are errors you can have all along so we click on mystery instance click on load and now we need to reference the ppk file so for this we go to connection ssh we open this and there is off and then under auth there is a private key file for authentication which you can browse and then we go to desktop or wherever you have saved your ppk file and reference your ec2 tutorial.ppk file now we're almost done don't click on open just yet we go back to session and we save it again this way our my ec2 instance save session will have the ppk file now click on open and all of a sudden things work we are inside the machine so we have a nice terminal and we can see that we are inside the machine for example if i type who am i i say i'm an ec2 user great and if i ping google.com i can see that google.com is responding and we get information from it so ctrl c and then to exit you can just press exit or exit using the way you prefer so i'll just go and press exits and as you can see things just exited now if i go back and one last time to putty just to verify the thing where properly if i click on my student sense load the profile usually if i go to ssh and again off now the private key file should be saved and so we're good to go we can just directly click on open and we have access session to the machine now what we'll do is that we'll do this pretty often so make sure you have the hang of it and we're ready to go into the next lecture to do some more fun stuff with ac2 so see you then you
Info
Channel: Stephane Maarek
Views: 24,912
Rating: undefined out of 5
Keywords: Udemy, AWS, Amazon Web Services, Stephane Maarek, Learn, Tutorial, IT, Amazon Cloud, SSH, Secure Shell, CLI, EC2, Key pairs, Security groups, Windows
Id: jv-dgOfFN4o
Channel Id: undefined
Length: 6min 13sec (373 seconds)
Published: Thu Mar 18 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.