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

preview_player
Показать описание
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.



_____________________________________________________


Take a look at the blog post covering OpenSSH Server Windows 10 install with Public key authentication here:

Рекомендации по теме
Комментарии
Автор

Thank you! I spent like 8 hours trying to figure out why I kept getting permission denied after following every ssh tutorial on YouTube.
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"

struggle
Автор

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.

paultruzzi
Автор

If every tutorial were as good as this one, we would be living in 3024 by now

pingupongu
Автор

I LOVE YOU, I WAS TROUBLESHOOTING FOR DAYS UNTIL I SAW YOU MENTION THE MATCH GROUP ADMIN PART

VincetheEditor
Автор

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 <Match Group administrators> part! Thank you for saving my sanity! Or maybe it's already too late..

Kman
Автор

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.

whats_skills
Автор

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.

arthursambi
Автор

great content i have been struggling with the ssh, but now it makes all sense 🙂 thanks a lot man you saved my life and you have a new subscriber! Great Work

smc
Автор

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.

middle_pickup
Автор

Thank you, I spent two days to set up ssh login without entering a password, only your video helped me figure it out!

dimedroll
Автор

Phenomenal! Thank you except one think. Disabling ssh by password got me to the
Permission denied (publickey, keyboard-interactive).
error which was bad. I want to be able to ssh in from anywhere with pw, and without pw from my trusted machines.

brockobama
Автор

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!

ameador
Автор

Omg you saved me so much time with this. THANK YOU.

landlubber
Автор

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.

FhargaZ
Автор

Thank you, this is one of the better videos I've managed to find online!

borys
Автор

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?

oscarmarreroengstrom
Автор

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.

SoundToxin
Автор

2023 windows 11 cliente hacia windows 10 ssh server > y estos pasos si funcionan, muchas gracias

danielhq
Автор

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. :)

vincentjay
Автор

you are amazing man, i almost had no idea how ssh works. great tutorial

leogryffindor