Remote SSH Configuration in VScode

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello and welcome back in this lesson we're going to install the remote ssh extension in vs code which will allow vs code to open a remote terminal in our vm and then we're going to take a look at the configuration scripts we're going to use to insert the vm host information such as the ip address into our ssh config file that vs code uses to connect to those instances so let's get started so first up i'm going to click on extensions here and i'm going to type remote ssh just like so and i'm going to click install all right that is all installed for me perfect so then let's take a quick look at it let's open the command palette and as you can see mine's already there but you can also start typing remote ssh and just to see how things work if you click on add new ssh host and let's just say ssh admin at admin.com or whatever let's go ahead and hit enter you can see you've actually got options potentially to configure different files go ahead and click on this first one we want this location to be within our ssh directory so click on that and if you open the config you can see i've actually got a lot here you can see the format we're looking at we're looking at a host hostname user and identity file just like so so what we're going to want to do is extract that information from our instance and insert it into this configuration file so let's take a look at how our script is going to do that let's go ahead and create a new file and depending on which operating system you're using let's go ahead and create the file necessary so since i'm on windows i will use windows dash ssh dash script dot tpl just like so and within that file i'm going to copy in the script you can find in the course resources so what this is going to do is add the host hostname user and identity file to that file that we specify now as you can see you've got this interpolation syntax here and what this is doing is essentially dictating that these are variables and those variables will be passed in using the template file function which we're going to cover very very soon so go ahead and save that and then i'm also going to create the linux one so you can see that so linux dash ssh dash script dot tpl and of course this also works for mac as well so the linux script is just like this you're basically cutting in the same type of stuff to our ssh config location all right so perfect so now we see exactly what's going to be used to add the information to that script we've seen the script and we've installed our ssh extension so coming up we're going to start prepping our code to add this information so that we can connect to our host using vs code so go ahead and mark this lesson complete come on back to the next one and let's continue the course
Info
Channel: More than Certified
Views: 60,915
Rating: undefined out of 5
Keywords:
Id: m6V8O853t9w
Channel Id: undefined
Length: 3min 42sec (222 seconds)
Published: Wed Mar 16 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.