How to Configure Visual Studio Code to Remotely SSH to an AWS Instance

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone today i'll be walking you through the process of establishing an ssh connection from your visual studio code to your amazon ec2 instance once you have your visual studio code go over to extensions search for ssh remote ssh is a recommended extension for this so you click on it mine is already installed but if it's not you will see install locally here go ahead and install once that is installed the next process would be to configure your ssh file or set up your ssh configuration file down to your left bottom corner of your screen there are two you see this green icon you can click click on this to open the window or alternatively you can from your windows machine you can click on ctrl shift p and it does the same thing then you can search for ssh and you open your ssh configuration file if that has not been set up yet your default setting should be slightly different but i would recommend you mirror the sighting shown on the screen and it's just four components which is the host usually aws server the host name the ec2 user and the identity file the host name changes because that is basically your public ip address and the location for your file should change as well for this demo i'll be using amazon linux2 click on launch t2 micro it's good because it's still free to your eligible configuration details i will leave everything as it is storage i'll leave as it is tags is highly recommended but i won't be using any tags for this demo because i will terminate this instance right after security group all we need is basically an ssh connection so i will leave as a default so everything looks good i'll go ahead and launch so what would be i would be creating a new key pair just so that we can walk through the process together so demo i would call it demo one and download this key pair once that is done we'll click on launch instance while back it's loading it will take it about a minute to create i would go over and set up my key so this location i'm going to change this to the new key that was just created so we can see it here so the recommended approach would be to copy your location so you see here copy address address has been copied we'll come back here to the locate the identity file and change the location so we'll change basically everything paste the new locations there and but the actual file isn't copied so we need to put that in manually and it's demo one we can just check to make sure properties it's demo one and pem so that's what we'll configure there's a missing piece all right so that looks good the next thing we need to change modify would be the hostname so all of those info can be found the host name is usually the public ip address but what i recommend because there are a few suggestions you also get from aws so you click on that and click on connect on the ssh client the same ip address shows up here and it tells you the user ec2 user so if this were to be ubuntu it's going to be it's usually ubuntu and it just varies with various linux distributions so i would go back again and just copy the public ipv4 address and that is what i would paste here to replace whatever was there before once that is done we can go ahead and save the file it's saved establishing a connection now we need to open up that window ctrl shift e for windows or the green icon here and ssh again but this time it's going to be ssh connect to host so this is where we're going aws server it will take about a minute less than usually it's asking us if for sure we want to continue click on continue and yes we have our connection uh we can check sudo yum update yeah so our image is up to date but this is just the general way uh sometimes it doesn't go smooth uh depending on dependencies the version of the use code and all of that you your machine if you happen to have any issues and you're not able to connect uh feel free to leave a comment below and we can try to troubleshoot that if you like my content give it give it a thumbs up and subscribe thanks and see you next time
Info
Channel: Tech with Frank
Views: 31,842
Rating: undefined out of 5
Keywords: remote development, vs code
Id: yrFcA7GuB0g
Channel Id: undefined
Length: 6min 16sec (376 seconds)
Published: Sun Jul 11 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.