Configure and Install OpenSSH Public key authentication in Windows 10 for remote connectivity

  Рет қаралды 34,449

VirtualizationHowto

VirtualizationHowto

Күн бұрын

OpenSSH server can be installed in Windows 10 and allows connecting using the SSH protocol to Windows 10 clients and Windows Server 2019 hosts. Using SSH allows you to standardize on the connection protocol you are using for remote connectivity to remote Linux and Windows hosts. It also provides great interoperability between Linux and Windows.
If you have a development pipeline running on a Linux box and it needs to connect to a Windows client or Windows Server, SSH connectivity is much less problematic than WinRM and even remote PowerShell connections. In this video walkthrough we will take a look at how to configure OpenSSH Publickey authentication in Windows 10 and look at how to do this step-by-step.
This can also provide a great alternative way to communicate with remote Windows clients and Windows Servers from configuration management platforms like Ansible.
Subscribe to the channel: / @virtualizationhowto
My blog: www.virtualizationhowto.com
_____________________________________________________
Social Media: / vspinmaster
LinkedIn: / brandon-lee-vht
Github: github.com/brandonleegit
Take a look at the blog post covering OpenSSH Server Windows 10 install with Public key authentication here:
www.virtualizationhowto.com/2...

Пікірлер: 67
@struggle375
@struggle375 11 ай бұрын
Thank you! I spent like 8 hours trying to figure out why I kept getting permission denied after following every ssh tutorial on KZbin. Just incase anyone else has the same issue as me, @ 8:15 notice the "Owner: testuser" is a local user. On my initial setup of ssh and creation of these files I was logged into Windows using a Microsoft account, NOT a local user. The owner of the "authorized_keys" must be the local "testuser"
@whats_skills
@whats_skills Жыл бұрын
Great video, very well explained. One thing I would add -- if your network is setup as a public network, you have to change it to private and allow network discovery. You can use ping to verify you're able to reach your device from another computer on your network. And finally, use the windows event logger to see any errors if you're still facing connectivity issues.
@ameador01
@ameador01 Жыл бұрын
I was trying to figure out how to access Linux instances via OpenSSH client on Windows with key authentication - this gave me the answer to that as well - the -i parameter with the private key location! Thanks!
@dimedroll
@dimedroll Жыл бұрын
Thank you, I spent two days to set up ssh login without entering a password, only your video helped me figure it out!
@middle_pickup
@middle_pickup 6 ай бұрын
Thanks for the info. I spent hours last night trying to get my windows 10 machine to accept key authenticated connections. Your config file changes were the fix.
@capitainethug5550
@capitainethug5550 2 жыл бұрын
I love your video, simple and precise! thank you very much!
@paultruzzi911
@paultruzzi911 Жыл бұрын
It would really help if you had different backgrounds or something so that it would be easier to know when you are on the remote server and local workstation.
@arthursambi2511
@arthursambi2511 Жыл бұрын
after re-watching and following your video many times (over 6 times) I finally got it too work. It was the switching back and forth between admin and your test user that flubbed me up. At one point you didnt mention switching back to the administrator and that is where I would mess up. Anyhow good video all in all.
@VirtualizationHowto
@VirtualizationHowto Жыл бұрын
Arthur, thank you for your comment! So glad you got it figured out. Thanks again!
@borys4206
@borys4206 Жыл бұрын
Thank you, this is one of the better videos I've managed to find online!
@VirtualizationHowto
@VirtualizationHowto Жыл бұрын
Borys, so glad you liked it and it was helpful!
@varunmurugan2349
@varunmurugan2349 Жыл бұрын
thank you very much...after days of searching finally got the solution !
@FhargaZ
@FhargaZ 11 ай бұрын
I checked many videos but this was the better explained one, thanks. If i try to create the folder ".ssh" with the account that is going to be setup for the connection i got "You must type a file name" and it seems it doesn't like the dot before the string. What i did was to create the folder as ".ssh." and then it removed the ending dot 😄I tested the keys from another server with Filezilla, i had to use the private key and it worked. And also i will check how to create a specific folder so they don't enter to the home user folder.
@jerkshop
@jerkshop 7 ай бұрын
dude you are one awesome guy! damn I am so happy learning!
@leogryffindor7930
@leogryffindor7930 5 ай бұрын
you are amazing man, i almost had no idea how ssh works. great tutorial
@VirtualizationHowto
@VirtualizationHowto 5 ай бұрын
Thank yuo u@leogryffindor7930!
@VirtualizationHowto
@VirtualizationHowto 5 ай бұрын
Also, be sure to sign up for the VHT forums where you can get personalized help on other issues, lab questions, etc: www.virtualizationhowto.com/community
@exus696
@exus696 11 ай бұрын
Very well explained. I am struggling to find maxlogins in limits.conf file equivalent in windows version of openssh. Is it possible ? Please help
@Kman3107
@Kman3107 10 ай бұрын
Oh my lord ! ! ! I tried getting public keys to work, but it never would. I have been stressing about for well over an hour (I'm afraid it might even be more), and the simple issue was that part! Thank you for saving my sanity! Or maybe it's already too late..
@SoundToxin
@SoundToxin 7 ай бұрын
The first few minutes alone were a big help. I had tried to follow a written guide on the winscp site but it did not mention editing sshd_config in ProgramData. Making sure pubkey auth was explicitly enabled and disabling password auth as well as commenting out those couple lines at the end of the file did the trick. I had already done most of the setup the other day and put my public key in the authorized_keys file but for some reason it just kept prompting me for a password when I connected, and this particular machine had no password and empty passwords aren't allowed by default so I couldn't get in at all. I was worried it was something with the permissions of the .ssh dir being wrong. My goal here was to get an ssh server running on this Windows machine in my house so I could use sftp instead of running back and forth with a flash drive. Most of my stuff runs GNU/Linux so I'm used to having ssh everywhere, but the setup on Windows was a bit unintuitive. Glad I've got this working now.
@TheVincent0268
@TheVincent0268 2 ай бұрын
Works perfectly!
@danielhq1253
@danielhq1253 11 ай бұрын
2023 windows 11 cliente hacia windows 10 ssh server > y estos pasos si funcionan , muchas gracias
@fuatcoskun4510
@fuatcoskun4510 6 ай бұрын
Great, thank you.
@kangourou702
@kangourou702 4 ай бұрын
Thanks a lot!
@matteopalese9261
@matteopalese9261 4 ай бұрын
really great video you saved my time and I learned a lot
@VirtualizationHowto
@VirtualizationHowto 4 ай бұрын
@mattheopalese9261 thank you for the comment! Glad the video helped!
@e.v.f595
@e.v.f595 Жыл бұрын
Love you ma man thanks a lot
@TheElvilla05
@TheElvilla05 Жыл бұрын
Thanks!!!
@oscarmarreroengstrom6115
@oscarmarreroengstrom6115 Жыл бұрын
I've been trying for a couple of hours but I seem to be stuck. Any help would be appreciated. I am getting a 'Permission denied (publickey,keyboard-interactive)' error when I try to ssh into the host (my desktop) from my laptop. I am confused about some parts of the video. It seems like the OpenSSH SSH Server and OpenSSH Authentification Agent services are being started from the Administrator user in the video. However, this seems to be the user from which a connection is made to the testuser at the end. Shouldn't these services have been started on the testuser and not the Administrator then? Another thing that I am confused about is where the ssh-keygen command should be run. Is it on the client or the host? The same goes for the authorized_key files, should it be on the client or on the host?
@0xjunimo609
@0xjunimo609 5 ай бұрын
The ssh-keygen command is run on the server to generate the public key for the client to use in its authorized_keys file
@mtagab007
@mtagab007 Ай бұрын
helpful !
@mohamedeladl6273
@mohamedeladl6273 Жыл бұрын
thanks
@_Mohanned
@_Mohanned Ай бұрын
Life saver!
@0xrofii69
@0xrofii69 11 ай бұрын
thanksss
@gems824
@gems824 7 ай бұрын
Will it work for SFTP as well?
@vincentjay7429
@vincentjay7429 Жыл бұрын
Just because it's commented out does not mean it is not working. There is a default state in config spelled out. If commented text ends with YES it is enabled by default and you only need to remove the hash when you want it OFF. :)
@Thewickedjon
@Thewickedjon 8 ай бұрын
im not sure what i'm doing wrong, I think I followed the instructions step by step but i must have missed something - to get past the (create the .ssh folder) i just powered my way through it with cmd > mkdir - where am I suppossed to generate the keys?? I did all of this on the server im trying to connect to., should I create the keys from the computer I want to use to connect to the server? - if the answer to that last question is (yes) , i tried it but it did not generate a public key, Is there anyone who can help me? Thank you!
@be-kind00
@be-kind00 5 ай бұрын
@VirtualizationHowto I'm confused at step of creating RSA key pairs . I have a windows 10 Pro PC and a synology NAS with SynoCLI Monitor tools that includes iperf. I want to be able to SSH into the Synology to use the iperf3 software. I also want to use the the perf client on Windows 10 and also create an SSH server to run that. So, the keypair thing is unclear to me about where you genereate them and where you put them (both pub and private). Also when I go into ADMIN Power Shell there is no user directory named ADMINISTRATOR so I went into my user folder and where I created the authorized.keys file. Later when I created id_rsa and known hosts file it put it in the same directory. So, I think I was supposed to generate the keys on the synology NAS and then put them in the authorized.keys file on the windows PC? It looks like you are creating an SSH Server in the begining of the video and then putting a client on the 2nd PC??? Also at the end why didn't you have to put a port number in when you logged in?
@VirtualizationHowto
@VirtualizationHowto 5 ай бұрын
@be-kind-for-u2 thank you for the comment. If you don't mind, create a topic on the VHT forums here and I can give you more personalized help: www.virtualizationhowto.com/community.
@be-kind00
@be-kind00 4 ай бұрын
@@VirtualizationHowto I did that
@VirtualizationHowto
@VirtualizationHowto 4 ай бұрын
@@be-kind00 awesome, let me know your forum username and I can create a new topic and mention you there.
@user-oh2fr4me2b
@user-oh2fr4me2b 4 ай бұрын
I have linux Redhat 8 client machine try to sftp to Windows 2022 with OpenSSH. Using password works fine but when i tried ssh key didn't work. i use, in sshd_config file Match User to their E:\sftp home folder not under C:\Users\UserProfile. Where to tell ssh to read authorized_keys file? is it under %Programdata%\ssh\sshd_config or under C:\Users\UserProfile\.ssh\authorized_keys? Thanks!
@VirtualizationHowto
@VirtualizationHowto 4 ай бұрын
@user-oh2fr4me2b thank you for the comment! Sign up here on the VHT forums and create a new topic and let's discuss this in more detail: www.virtualizationhowto.com/community
@ethanweatherhead4087
@ethanweatherhead4087 Жыл бұрын
what about using a yubikey generated in openpgp, i want to ssh with the yubikey on command prompt to multiple servers how do i do that?
@VirtualizationHowto
@VirtualizationHowto Жыл бұрын
Ethan, check out this link for configuration info using Yubikey: developers.yubico.com/PGP/SSH_authentication/index.html
@ethanweatherhead4087
@ethanweatherhead4087 Жыл бұрын
@@VirtualizationHowto I've seen this documentation as well as dr duh's writeup, but i'm still quite confused, i think it has something to do with the ssh-agent, i want the local host to obtain the private key from my yubikey where the remote machine can identify through that in order to create a passwordless connection, could you do a tutorial on that please (specifically on command prompt windows) thank you....
@everdomeio7855
@everdomeio7855 2 ай бұрын
no matter what i did, always ask me for password for somereason, i dont even have password on my windows, could u tell me how to fix that
@user-yc9cr1tm9m
@user-yc9cr1tm9m Жыл бұрын
In my case, the error "Permission denied" appeared. O ssh did not accept the private key because the file "id_rsa" did not have the proper permissions, and the warning appears (use the -v parameter) "WARNING: UNPROTECTED PRIVATE KEY FILE!". Change permissions and leave only for your user, administrators and the system. Good luck!
@uguremirmustafaoglu40
@uguremirmustafaoglu40 11 ай бұрын
Sound quality of the video prevents this valuable content to be appeared on top of the search.
@VirtualizationHowto
@VirtualizationHowto 11 ай бұрын
Ugur thank you for your comment. Definitely trying to improve on video quality, audio in particular :)
@thenewone3944
@thenewone3944 Жыл бұрын
what about a key generated on a linux server to windows? I've done all of the steps shown and it is still prompting for a password
@technerd3455
@technerd3455 3 сағат бұрын
same here
@adrian_franczak
@adrian_franczak Жыл бұрын
still cant connect from macos to windows - Permission denied :/
@BadAtEverything555
@BadAtEverything555 Жыл бұрын
Same, did you end up figuring it out?
@adrian_franczak
@adrian_franczak Жыл бұрын
@@BadAtEverything555 to private Windows laptop there is no problem - to my work laptop I can’t but rdp works fine - if I add -vvv there is something about successful connection and then dropping by server with code X
@user-yc9cr1tm9m
@user-yc9cr1tm9m Жыл бұрын
In my case, ssh did not accept the private key because the file did not have the proper permissions as shown in the video, and the warning appears (use the -v parameter) "WARNING: UNPROTECTED PRIVATE KEY FILE!". Leave permission only for your user, administrators and the system. Good luck!
@patchbyte6856
@patchbyte6856 6 ай бұрын
I hate windows so much
@gamercabbar9233
@gamercabbar9233 7 ай бұрын
Cant save the ssh config file but i am administrator
@AjayYoutube-rz2so
@AjayYoutube-rz2so Ай бұрын
Same issue did u got any solutions?
@eltechnica
@eltechnica 3 ай бұрын
bro, you need to zoom in so we can see what youre doing, no one needs to see your face either.
@adityasprojects7126
@adityasprojects7126 6 күн бұрын
i love you.......... 😍😍😍😍😍😍😍😍😍😍😍😍😍😍😍😍😍😍😍😍😍😘😘😘😘😘😘😘😘😘😘😘😘
@Konstantin_Liberty
@Konstantin_Liberty Жыл бұрын
*Thank you so much. I sat up half the night, did not understand what it was, and it turns out it was necessary to comment out the last two lines.* # Match Group administrators # AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys
@VirtualizationHowto
@VirtualizationHowto Жыл бұрын
Ah yes imLEGR, I have ran into this as well. I may have missed this in the video? I will need to rewatch to see. Thanks for the comment!
@Konstantin_Liberty
@Konstantin_Liberty Жыл бұрын
@@VirtualizationHowto Just thanks to your video I made ssh, thank you. If it were not for you - I would have been looking for a long time why my connection does not work. Your video helped me :)
@Leandro-df9hp
@Leandro-df9hp Жыл бұрын
thanks a lot, very helpfull
@jstbe
@jstbe Жыл бұрын
Thank you so much for the detailed guide!
OpenSSH for Absolute Beginners
23:00
Veronica Explains
Рет қаралды 94 М.
OpenSSH for Windows: The IT Admin's Key to Remote Management
33:53
TechsavvyProductions
Рет қаралды 14 М.
Can You Draw The PERFECT Circle?
00:57
Stokes Twins
Рет қаралды 74 МЛН
where is the ball to play this?😳⚽
00:13
LOL
Рет қаралды 14 МЛН
Glow Stick Secret (part 2) 😱 #shorts
00:33
Mr DegrEE
Рет қаралды 50 МЛН
SSH Keys
10:12
RobEdwards
Рет қаралды 96 М.
SSH Full Course - EVERYTHING You Need to Know!
1:28:00
Learn Linux TV
Рет қаралды 551 М.
40 Windows Commands you NEED to know (in 10 Minutes)
10:54
NetworkChuck
Рет қаралды 3,1 МЛН
How SSH Works
8:54
Mental Outlaw
Рет қаралды 459 М.
Microsoft CEO on How New Windows AI Copilot+ PCs Beat Apple's Macs | WSJ
8:59
The Wall Street Journal
Рет қаралды 244 М.
OpenSSH is about to change. (For the better.)
10:00
Veronica Explains
Рет қаралды 138 М.
SSH To Windows Using Public Key
13:40
William Campbell
Рет қаралды 68 М.
Best Free Hypervisors in 2024
12:16
VirtualizationHowto
Рет қаралды 75 М.
Bro be careful where you drop the ball  #learnfromkhaby  #comedy
0:19
Khaby. Lame
Рет қаралды 11 МЛН
П*ВО ДЛЯ СОБАК
0:47
Натали Макколи
Рет қаралды 2,7 МЛН