How to Install OpenSSH Client and Server Using PowerShell in Windows 10

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
installing openssh and the gui can be cumbersome sometimes we're going to streamline it in this video by installing it via powershell hello ladies and gentlemen thank you for tuning in in the previous video we showed you how to install the openssh client in your windows 10 machine but we did it through the graphical user interface and we've paid attention to a lot of the comments uh we encourage you to comment below on this video as well and what we're going to do in this video is we're going to show you how to install it via powershell we've gotten some requests for that so we're going to go ahead and take the time to show you how to do that but we're going to go a step further in the first video what we showed you how to do is just bring the client online and connect to an ssh server what i want to do in this video is i want to show you how to install and bring online the open ssh client on windows 10 but also show you how to bring the server online via powershell and allow us to test the connection join me here in order to do this we have two virtual machines both running windows 10 and if you're ever wondering what version of windows 10 currently you are running you can always open up powershell and you can type in winver all one word winver and that'll allow you to see what the version is currently that you're running and you can see that currently we're running the 21 h1 build so i would encourage you that if you want to follow along out there definitely use this build for your lab purposes now i've got two machines here the first machine here i have named the win10 ssh client we're going to get the client installed on this machine and then once we have that done we're going to switch on over to another windows 10 machine that i've called windows 10 ssh server and what this is going to hopefully help you do is distinguish which machine we are on we're going to bring on a bring up a client and then what we're going to do is switch over to the server we're going to install the open ssh server role on this machine and then we'll switch back over to our client and make an ssh connection to verify that our installation has succeeded you know and is successful so let's go ahead we're going to bump on over to our windows 10 and we're going to install our ssh client now there's a couple of ways that you can check to see if this is installed ahead of time at some point i'm guessing that ssh will probably be built into powershell currently it isn't but if you want a really easy way to find out hey do i have ssh or the open ssh client already installed you can just type in ssh and when you run that if you get an output that isn't red chances are you already have ssh installed and if you do you can always skip forward a little bit and we can show you how to uh install the open ssh server later in this video now if you find out that you've got something like what i have here a bunch of red text it's telling you it doesn't exist and that means that we're going to have to install it the other way that you can check this via powershell is a commandlet called the get windows compatibility and if you want to check this out all you have to do is type get windows compatibility here and then we're going to do a space and we're going to hit a dash or a minus sign if you will and we're going to type online and then another space another dash or a minus sign if you will and we're going to type name and now we're going to name the package it is that we're looking for and for us that's going to be open ssh dot client and we're going to do four tilds and then we're going to type in the version the open ssh client here for us it's going to be 0.0.1.0 and we're going to fire this off oh and it's letting me know that this requires a an elevated power shell prompt if you will and this is something to keep in mind um when you're going to make modifications to your windows 10 operating system you are required to be an administrative user and not a standard user and that's why i'm getting this error here so real easy we're just going to go ahead and close this power shell down we'll right click on the powershell icon that i've got pinned to the taskbar and i'm going to choose run as an administrator what we should see is that's going to fire off the user account control requiring us to say yes and now we have an administrative powershell prompt here now inside of the powershell prompt i'm going to go ahead and just type a cd backslash and then i'm going to clear the screen gives us a little bit more real real estate now all we have to do is rerun that same command get dash compat uh windows compatibility space dash online space dash name and then remember to get the package right this is open ssh dot client four tildes 0.0.1.0 and we run this and this time when we run it if we've got the administrative power shell open uh it'll allow us to look down into the windows subsystem and find out if it is currently present now notice what it's letting us know or give us a little bit of information here it says that the open ssh client isn't available now that's how you do it formally in powershell but remember it's just as easy to type ssh if you want a little faster way to tell if you've got it installed now once we can validate that well we don't have it installed we can actually just use our up arrow and make it easier to type because you've seen my typing abilities here and i'm going to change the verb at the first part of that commandlet from get i'm just going to backspace that out and i'm going to type add all right and it isn't case sensitive but i'll go ahead and try to keep it true to the win of the powershell syntax if you will and we'll hit enter now you're going to see that i get this little green or aqua type green bar over here and every time anytime your powershell is reaching out to microsoft servers whether it's updating the help files or in this case adding a functionality you're going to get this little progress bar here and depending on how much how many resources you have in your system how fast uh your internet speed is if you will your network connection then coupled with how big the package is that you're installing it could take you a little bit of time for this to finish now once it finishes we can what we're going to do is we're going to show you what it would look like if we were to run the get dash windows compatibility looking at that operating system and verifying that hey the uh the package is present and is installed so while we're waiting on this what i'm going to go ahead and do is i'm going to jump back over to the next machine and we're going to verify if we've got the open ssh server installed and we're going to go ahead and we're going to download and install that package so let me go ahead i'm going to switch over to the windows 10 machine that i'm using as my windows open ssh server and we're going to type that same command but we're going to modify the package name a little bit here too so i'm going to type get windows compatibility and then space and we're going to do an online space dash name making sure that i spell it right syntax is everything here and we're going to type open ssh dot server we're going to do four tilds and 0.0.1.0 and we're going to go ahead and run this and again it's telling me that this requires a elevated um powershell uh window so i'm going to go ahead and close this down right click on my powershell icon we'll run this as administrator it'll trigger the user account control so again if that happens it's perfectly fine it was just a standard user's power shell we want the administrative powershell and i'll do the same thing that i did before we'll do a cd backslash and clear the screen and we'll rerun that command and now that we have that elevated powershell prompt what we should see here is whether or not the open ssh server capability is actually installed and i can see right here that it says it is not present so we want to go ahead and we want to install this as well now the great thing is we can rerun this command lit and i'm going to do the same thing that we did for our client i'm going to just change that verb there in the first part of the command lit from git to add and we're going to go ahead and we're going to run this and you can see the same thing is going on here that was going on on the client side it's reaching out to microsoft's update servers and it's going to pull down this extended functionality now we switch back over to our client we'll let that go ahead and run and at this point if we re-run on our open ssh client if we run that get windows compatibility again just by pushing the up arrows what we should see now is that the state has gone from not installed to installed and that's what we want let me show you real quick there ladies and gentlemen what i was talking about an easy way to figure out if the ssh client is installed remember i told you you could just type ssh now once it's installed you might see that you get some output that will give you some options with ssh and it doesn't seem to be doing that here but it could be available depending on which version of the windows operating system you have more specifically which build of windows 10. alright so uh we're still waiting on our uh windows open ssh server to come online and uh what we're gonna we're gonna go ahead and do is we'll take a little bit of a break here we'll let this get installed and then we'll join you in once it's finished and we'll uh move forward in our demonstration so now you can see right there that it tells us that uh you know uh online our computers operating system is still running and it's asking us if we need a restart if we run that get windows compatibility one more time what we should see is that the state has gone from not present to installed now you might think that we're ready to go right we've got our op we've got our open ssh server uh feature installed but uh the case that's just not the case what we have to do is we have to do a couple of things remember that the server responds to incoming requests which means it's a service we need to get that service started but the other thing i want to show you how to do is not only how to get the service started because if we start the service and then we reboot the computer the service isn't going to start again so that could be problematic especially when you're talking about things like servers which you typically don't reboot much let me show you how you can verify that the service is present and whether it's running or not very easy powershell commandlet just type get service and you can do a space dash name and ssh and i'm going to go ahead and put a little asterisk behind it because i know there are two services that are present one that we currently don't need one that we do and when i run that you can see we have the open ssh authentication agent which is installed by default it's not running by now right now that's actually going to come up in a later video that we're going to do when we talk about things like key based authentication here in windows 10 on openssh server uh but the one that i want is the one that says stopped underneath that that's sshd or the secure shell daemon we want to get that up and running all right but before we do that let's change this service to start automatically which means the moment we push power on this computer that service is going to start up and in order to do that what we can do is a set dash service space name and what i'm going to do is i'm going to type sshd space and then we're going to type a dash startup type and then from here single quote and then we're going to type automatic and we're going to hit enter now very anti-climatic here doesn't really look like it's done much but all it said is hey let's go ahead and when that uh when the operating system starts up let's get this service online and running but now what we need to do is we need to start the service and if we want to start the service it's very easy to do all we have to do is do a start service space dash name and sshd and hit enter and when we hit enter it's asking us waiting for that service i pushed uh enter too many times it was telling me to slow down and now what we need to do is just verify that the service is actually started up and then we should have an open ssh server ready to go all right so we'll go ahead and we'll do a git service and then we got our ssh and i just kept the asterisk there to give me anything that starts with ssh and i can see that our ssh server is running now the last thing that we want to show you is that verify that our client can connect to our openssh server now this is another uh some of the comments that we've got in our youtube channel there on the last video that we did and it can get a little bit confusing as when we log on what credentials do we use this is our open ssh server that we've got installed and running uh that you've seen me use powershell all right this in order to connect to this ssh server i have to have an account that has the privileges on this server to log in and that's important to understand all right so we're on our uh client machine again our one that uh our machine that is running the ssh client now earlier you've probably seen where i typed ssh after we had the open ssh installed and it still gave me the red text what you might have to do sometimes you might have to do a refresh if you will uh in powershell and it's just like any other reboot all it is is just closing down the powershell uh window you can right click on it and for me i'm going to go ahead and just run it as administrator typically with the ssh client you don't have to run it as administrator but you're going to notice now once i've restarted the powershell interface here what we're going to do is we're going to connect back to our ssh server now it's important to understand when it comes to the authentication i'm on my client when i connect to the server over the network from here i have to use an account that's on the open ssh server and it has the privileges to log in all right i don't want you to think that when i use this powershell on my client that i'm using any user account on this client it's actually on the server but here let me show you what i was talking about when you run ssh if you've already got it installed this is what you should see not what you seen earlier after we installed it it was still giving me that red text i just closed down the power shell open it back up and it sees as an available package now now in order to connect i'm going to go ahead and clear the screen here we're going to type ssh space and remember i'm typing an account a user account that is on the ssh server so stu student o2 is actually an account on the windows 10 machine running the open ssh server we're going to go ahead and use the at symbol and i'm going to use the local iep address of the machine so for me that's 10.0.13.1 and we're going to hit enter and now what we see is we've got some authentication that's going on this is our authent this is our server saying hey this is who we are or who i am and you need to verify that you know and trust that server i'm going to type yes and now we are connected and i'm going to go ahead and i'm going to do a cls on this screen and let me enter the password doesn't seem like it like that okay there we go now we're logged in and if you notice the username here notice it's student o2 at and then it says win10 ssh server that's very important and again based on some of the comments we got when we shown you how to do this through the gui how to get the client online some people didn't quite understand how i was authenticating again keep in mind that i'm using an account that's on the ssh server and if i need to verify that other than just the command the prompt here i can always type who am i and you can see that this is a this is student note 2 with that account on the open ssh server all right there you have it ladies and gentlemen so in this video remember that we've shown you how to stand up the open ssh client uh first to verify if it wasn't even if it was present in the first place then once we got it installed we tried to verify whether it was installed or not but we needed to shut down our power shell reopen it and then you can see just typing ssh verifies that it is installed we also went to another windows 10 machine the one that we called the openssh server we installed the openssh server service through powershell and then finally jump back over to our client made our connection logged in that's it ladies and gentlemen that's how you install openssh on windows 10.
Info
Channel: ITPro
Views: 16,796
Rating: undefined out of 5
Keywords: install openssh, install openssh server on windows 10, install openssh on windows 10, install openssh in windows, how to install openssh, how to install openssh on windows, how to install openssh on windows 10, how to install openssh client on windows 10, install openssh with powershell, install openssh using powershell, how to install openssh using powershell, how to install openssh with powershell, how to install ssh server windows 10, windows 10 openssh, powershell ssh client
Id: Zin9xhU5P58
Channel Id: undefined
Length: 16min 4sec (964 seconds)
Published: Fri Jul 16 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.