Remote Development on VSCode with SSH

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
so if you have installed vs code on Windows and you want to do remote development on a Linux computer or Linux server this is how you configure vs code for SSH based remote development first of all you should have access to your Linux server it could be someone else's machine it could be your computer as well so I can just configure a Linux server let's log into that to SSH so once I have logged into the server I now do have to configure the server for my purposes but as long as you can log into the server it's enough now for example if you want to use your vs code instance for doing web development you have to install node.js and accordingly all the corresponding dependencies and for example if you want to do C and C plus plus development you have to use something like this thank you yeah if you have a Windows if you have a Ubuntu server for example Linux server so in that case probably and if you are doing C and C plus plus development you probably need these packages right so let's install those right so let me just [Music] since the installation failed and just do an update on that repository list all right and let me just install all these packages if possible foreign so we are all done basically now for example if you want to do python development you have to install anaconda or some other python distribution and you may also install the repository given packages for python as well but uh so far so good so let's look into the vs code installation for example so assuming that we have installed vs code and now we want to actually go into the SSH based remote remote development here right so for that we need to install one extension and if you just search for ssh in vs code plugin suppository here so basically you would have this very first option says remote SSH and just install that so it may take some time to install this okay okay all right so we just successfully installed this and once you install this look right in the left bottom corner here so you see that there is a option to open a remote window so click on that okay and it says connect to a host all right so let's click on that so if you're doing it for the first time it will say ask add a new SSH host right so click on that and since we have we are using SSH with a password so let's again go back to what we had so just exit from here okay all right so if you see that again the command to log into this particular server is this again this could be your local IP address it could be a properly forwarded domain here as well and this is your username at this moment I am using the root user from this server but this is overall the yeah the command that you need to have right so let me just put that here all right so and so again SSH is the command that you're using root is the username and this is the IP address of your server so let's hit enter here okay and you might have a multiple SSH files that you can update Okay so use the first one probably and now here down in the bottom you probably have an option to connect if you don't have that or if you just somehow cross that no problem you just click on this one again open a remote window and again it will ask you to connect to a host please do that now you again it has now remembered what IP address you try to log in now for the first time when you do this it will actually ask you to actually choose what kind of operand is operating system you have in that remote machine here of course we are doing development on Linux computed so you have to choose Linux of course and accordingly it will actually set up and now of course you have to put your password now again so again this is the username again you see root is a user for example this one in this one now when I put my configured password correctly I'm going to close this window here so now we have an active sh connection to that of course right and it says that it has selected Linux as a remote platform and you will actually save that configuration now we can of course change that later all right so now we have successfully logged into that particular machine with our vs code installation right so now if you of course if if you go to this terminal and launch a new terminal okay and the terminal will be launched in that remote machine right so this is again that particular remote machine that we have logged into and if you for example if you want to do c program development for example you create a folder again for that go to terminal for example this is again one of the ways there are several ways to actually doing this and so let's create One Directory where we might have our projects so let's see let's create a directory so let's call that directory test project and let's move into that directory all right so we are inside that directory and once we are inside that directory it's fine so now it says Fine uh let's open the folder here it's a when you go to this tab here opening folder Explorer folder and there you if you go to this open folder you have actually all the folders that you just created so basically in the root directory of the user so now hit OK and there you have opened your project so now again it will ask for your password so once you have done that again again this is a security measure then you have to actually trust the authors of this folder again to avoid unnecessary execution of untrusted code so let's trust this because I know I created this all right and let's create a new test file and let's say I want to create a c program and let's call this main.c again it's a feature of vs code the moment you do something like this you created a c program it will ask for you to install the recommended extensions now some of the extensions will be installed in the remote machine and some of the installation extensions will be installed in the local machine here okay so let's install whatever recommended extensions they are giving me all right so it seems like we're done for the most part right so we have installed all the extensions let's let's clear this thing all right so as you see we have installed a few local extensions and we have installed a few extensions in the remote machine here all right all right so nice so let's uh go into this one and again there is there will be this button for the remote Explorer basically you can actually explore the remote machine as a file with this file browser basically right so let's create a simple C program to test what we have just done so you can see that the auto completion is working foreign so let's save this program again this program is not getting saved in your local machine it is getting saved in your remote machine actually and so let's uh go to the terminal okay and no let's go to the Run option here and let's run without debugging that's it and we have several options based on whatever compilers we have installed so let's choose the first one here in this one we're just using vanilla GCC without any difficult options again all right so let's go to that one so it started debugging by the way and so you just go to the output no maybe let's go to the terminal yeah so there you have it so that's how you actually log into the remote machine of course if you configure a python installation there in your remote machine and create a python project here it will of course install whatever recommended extensions it needs to actually get that to work all right so thanks for watching I will see you in the next one
Info
Channel: Tanmoy Dasgupta
Views: 49,511
Rating: undefined out of 5
Keywords:
Id: SF9IgA9Z8Tg
Channel Id: undefined
Length: 9min 57sec (597 seconds)
Published: Mon Jan 09 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.