How to automatically start ssh server on boot on Windows Subsystem for Linux
Microsoft partnered with Canonical to create Bash on Ubuntu on Windows, running through a technology called the Windows Subsystem for Linux. Below are instructions on how to set up the ssh server to run automatically at boot.
- Edit the
/etc/ssh/sshd_configfile by running the command
sudo vi /etc/ssh/sshd_configand do the following
Portto 2222 (or any other port above 1000)
PasswordAuthenticationto yes. This can be changed back to no if ssh keys are setup.
- Restart the ssh server:
sudo service ssh --full-restart
- With this setup, the ssh server must be turned on every time you run Bash on Ubuntu on Windows, as by default it is off. Use this command to turn it on: