How can I SSH into "Bash on Ubuntu on Windows 10"?
I got it to work; here's how.
Uninstalled ssh-server, reinstalled it and made sure it's started with
sudo service ssh --full-restart
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.
The above answers came close, but I still had a Connection closed by 127.0.0.1
issue.
So starting over from scratch and supplying the --purge
option when removing the sshd
package (as I demonstrate below), solved my variation of this issue:
user$ sudo apt-get remove --purge openssh-server # First remove sshd with --purge option.
user$ sudo apt-get install openssh-server
user$ sudo vi /etc/ssh/sshd_config # **See note below.
user$ sudo service ssh --full-restart
# ** Change Port from 22 to 2222. (Just in case MS-Windows is using port 22).
# Alternatively, you can disable MS-Windows' native SSH service if you
# wish to use port 22.
I hope this helps. \(◠﹏◠)/
Since windows implementation doesn't provide chroot you need to modify the /etc/ssh/sshd_config
UsePrivilegeSeparation no
Also you will need to create a user using useradd command or so.