1

I'm trying to turn my Windows 10 desktop into a secure ssh server. sshd is running but I can't get any of my other computers to connect to it. I'm using passkey authentication with ed25519. I'm using the same keypair as my arch Linux server.

I started by updating

sudo apt-get update && sudo apt-get -y upgrade

installing

sudo apt-get install openssh-server

then adding the following to nano /etc/ssh/sshd_config

PermitRootLogin no
PubkeyAuthentication yes
AllowUsers user21303
PasswordAuthentication no
ChallengeResponseAuthentication no UsePAM
yes X11Forwarding yes
PrintMotd no
AcceptEnv LANG LC_* Subsystem  
sftp    /usr/lib/openssh/sftp-server

Copy id_ed25519.pub to ~/.ssh

chaged the permissions

sudo chmod 700 .ssh sudo chmod 644 .ssh/id_ed25519.pub

verified the permissions have been set with ls -la

Restart the service

sudo service ssh --full-restart

Verify the service is running

service ssh status

is runnning

When I try to connect to my host's IP address nothing happens. I used tripple verbosity and I get the same error I would if I were connecting to an invalid IP:

OpenSSH_7.8p1 Debian-1, OpenSSL 1.0.2o 27 Mar 2018
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: resolve_canonicalize: hostname 192.168.1.180 is address
debug2: ssh_connect_direct debug1: Connecting to 192.168.1.180 [192.168.1.180] port 22

I get the same error message as if I were to connect to a non existing IP address.

I do have internet. I can ping 8.8.8.8, etc.

How can I further diagnose this problem. I would like to know how to search for the cause rather than just brute force Google. Thank you for your time.

  • What's the actual error message? Is it a general networking issue? – Jeff Schaller Oct 10 '18 at 17:05
  • the error is as follows... < OpenSSH_7.8p1 Debian-1, OpenSSL 1.0.2o 27 Mar 2018 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 19: Applying options for * debug2: resolve_canonicalize: hostname 192.168.1.180 is address debug2: ssh_connect_direct debug1: Connecting to 192.168.1.180 [192.168.1.180] port 22. > ...I get the same error message as if I were to connect to a non existing IP address. – user21303 Oct 10 '18 at 17:16
  • 1
    I vaguely remember that you have to add a firewall exception. Also notice that Windows 10 comes with a built-in OpenSSH server. – Arkadiusz Drabczyk Oct 10 '18 at 18:01
  • Having this all as one line is wrong: ChallengeResponseAuthentication no UsePAM yes X11Forwarding yes – roaima Oct 10 '18 at 18:29
  • They are not all on one line. I just formatted it poorly. – user21303 Oct 10 '18 at 19:12
3

The WSL kernel is not the Linux kernel, and in fact WSL does not run with more privileges than your common windows application.

Furthermore, when you close WSL, all applications will be killed. There are clunky workarounds, with varying degrees of mild success. Just keep in mind it is problematic.

I would not invest time into using WSL as a shell/SSH server. In fact, your chances of success are greater using cygwin.

If you really need Ubuntu and a SSH service into it, I recommend instead using a VM

see my answer here Can't access SSH server running in WSL - some information here might already be outdated, but it illustrates well the differences between real Linux and WSL.

see related Attempting to run a regular tunnel in Debian version 9.5 Linux

  • 1
    Or just use Windows 10 built-in SSH server unless you need *nix environment. – Arkadiusz Drabczyk Oct 10 '18 at 18:27
  • @ArkadiuszDrabczyk Or do like me and negotiate an exception to the corporate Windows desktop at hiring time ;) – Rui F Ribeiro Oct 10 '18 at 18:41
  • Fair enough. I’ll just set up sshd for cygwin. I mostly just want to be able to log in and download/upload files via ssh – user21303 Oct 10 '18 at 19:16
  • "Furthermore, when you close WSL, all applications will be killed.": this is not true and hasn't been for some time (well before the date of the answer you linked, even). – Michael Homer Dec 14 '18 at 0:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.