I have Windows 10 Anniversary Edition with "Bash on Ubuntu on Windows" installed and working. I'd like to be able to SSH into this Ubuntu instance, but although I have openssh-server installed and configured (and listening on port 2200), when I try to ssh to "localhost:2200", it tells me "Server unexpectedly closed network connection".
Has anyone been able to successfully accomplish this?
Best Answer
I got it to work; here's how.
Uninstalled ssh-server, reinstalled it and made sure it's started with
Make sure you turned off root access and added another user in the config file.
I was able to connect to the subsystem on 127.0.0.1:22 as expected. I hope this will help you.
sudo apt-get purge openssh-server
sudo apt-get install openssh-server
sudo nano /etc/ssh/sshd_config
and disallow root login by settingPermitRootLogin no
Then add a line beneath it that says:
AllowUsers yourusername
and make sure
PasswordAuthentication
is set toyes
if you want to login using a password.Disable privilege separation by adding/modifying :
UsePrivilegeSeparation no
sudo service ssh --full-restart
Connect to your Linux subsystem from Windows using a ssh client like PuTTY.