September 1, 2024

What if we could run an SSH server on my windows machine?

Now that we are playing with dotnet on linux, it would be interesting to have convenient access to my Windows machine.

The answer seems to be OpenSSH. The claim is that OpenSSH is installed with Windows 10 and just needs to be enabled! I want to look for "OpenSSH Server".

I go to Settings, Apps, and I see Apps and Features. I do not see "Manage optional features" as I am supposed to. And searching for it fails. The "Manage optional features" page is supposed to give me and "Add a feature" button.

Maybe I have to be logged in as a user with admin priveleges. I log out then back in as an admin user. I have to try the password 3 times, but my old boy password eventually works. It sure is slow. This is no different, so apparently they lied to me about this being included with Windows 10.

I search on this business of "no optional features" and learn that this has been moved to Settings > System. Yep, there it is, so I go to it, click on add a feature, the search finds OpenSSH server quickly and I select it. Then I click the Add button at the bottom and get a progress bar.

I'll note in passing that there is also an OpenSSH client offered, but that is not what we want at this time. It takes forever, but finally says "Added". Allegedly the binaries go to /Windir/system32/OpenSSH and it puts sshd_config and host keys into /ProgramData/ssh (after you start the server the first time)

Since this was installed as an optional feature, the firewall rules should have been set up for it.

Of course we want this to start every time automatically.
Go to Control Panel -- System and Security -- Administrative Tools -- Services
locate OpenSSH SSH Server service
Locate Action -- Properties and change the startup type to automatic

I do this. I also start the service when I am there.

Try it

It works! After a short bit deleting old entries from my known_hosts files on my linux machine, I get:
Microsoft Windows [Version 10.0.19045.4780]
(c) Microsoft Corporation. All rights reserved.

tom@GILA C:\Users\Tom>
I can use "scp" as well!

It does prompt me for my password as user tom - as it should. I can set up keys if I find myself using this regularly.

I can even login as the admin user (root) that I setup.


Feedback? Questions? Drop me a line!

Tom's Computer Info / tom@mmto.org