How to start Openssh server after install in WSL?

7,350

WSL does not automatically start sshd

Try removing the ssh server with:

sudo apt remove openssh-server

And then install it again with:

sudo apt install openssh-server

Then check the server status to see if it is running. If not, try:

sudo service ssh start

to start the server. See more here

Hope this helps

Share:
7,350
Kimani_Kelly
Author by

Kimani_Kelly

Updated on September 18, 2022

Comments

  • Kimani_Kelly
    Kimani_Kelly over 1 year

    I'm trying run the command ssh localhost but receive the error

    ssh: connect to host localhost port 22: Connection refused

    WhenI try to check the status of the SSH Server with the command sudo service ssh status I receive the error

    • sshd is not running

    I installed the SSH Client with sudo apt-get install openssh-client and the SSH Server with sudo apt-get install openssh-server ii. What else could the issue be thank you.

    • Kimani_Kelly
      Kimani_Kelly almost 4 years
      @user68186 Thank you that fixed it the sshd is now running.
    • user68186
      user68186 over 3 years
      I have converted my comment to an answer. Please accept the answer below by clicking on the gray check mark ✔next to it and turn it green ✅. This will indicate that the answer is correct and help others with the same problem. You can also up-vote my answer to show your appreciation.