Skip to content

Instantly share code, notes, and snippets.

@harleyday
harleyday / WSL-ssh-server.md
Last active Feb 25, 2021 — forked from dentechy/WSL-ssh-server.md
A step by step tutorial on how to automatically start ssh server on boot on the Windows Subsystem for Linux running Ubuntu 18.04
View WSL-ssh-server.md

How to automatically start ssh server on boot on Windows Subsystem for Linux


This works with Ubuntu 18.04LTS. I make no promises about other distributions, but direct anyone else to an older Gist which apparently works for 16.04LTS.

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.

  1. Uninstall and reinstall the ssh server using the following commands:
    1. sudo apt remove openssh-server
    2. sudo apt install openssh-server
  2. 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: