Instructions to create an ssh connection into the windows subsystem for linux.
- Enable and install the Linux Subsystem for Windows 10.
- [Recommended] In Windows, install git-bash.
Follow these steps in order to enable ssh-connections into your Linux Subsystem:
- Enter you Linux App.
- Uninstall the SSH Server:
sudo apt-get purge openssh-server
- Reinstall the SSH Server:
sudo apt-get install openssh-server
- Edit the ssh-config file:
- Disable root login:
PermitRootLogin no
- Grant access to your user:
AllowUsers <your-user-name>
- Enable password authentication:
PasswordAuthentication yes
- Disable privilege separation
UsePrivilegeSeparation no
- Change default port:
Port 2222
- Reestart the SSH Service:
sudo service ssh --full-restart
Now you can connect via ssh (using PuTTY or git-bash in Windows). Example:
- Open git-bash terminal
- Connect via ssh:
ssh -p 2222 <your-user-name>@<your-ip-address>
- Or connect via sftp:
sftp -P 2222 <your-user-name>@<your-ip-address>
To find out your ip run:
- In Linux run
ifconfig
and see the inet value unser the wifi block. - In Windows run
ipconfig
and look for the IPvX Address in the Wifi-Adapter block.
/etc/ssh/sshd_config