Visual Studio 2017 cannot connect to WSL, says username and password are incorrect

I followed this tutorial from Microsoft . I created my WSL username and password, installed all the required applications and started the SSH service. The problem is I want to connect to it from Visual Studio in the menu Tools > Options > Cross Platform > Connection Manager

.

I follow the instructions:

  • Hostname = localhost
  • Port = 22
  • Username = Username I created for WSL
  • Authentication type = Password
  • Password = The password I created for the WSL username.

When I do this, it says my username or password is wrong. But I know they are correct. I cannot post images to show them because my reputation is not at 10 yet, but it underlines the red line of username and password and saysAuthentication failure. Please make sure credentials are correct.

I know I can connect to devices because I tried to connect to my raspberry pi. Whenever I try to debug anything on this it gives me a segmentation fault. But this is another question for another day.

Any ideas as to why I can't connect to WSL?

+3


source to share


1 answer


Using the information in this link I was able to solve the problem. I just had to change port from 22 to a different port.

do: sudo nano /etc/ssh/sshd_config

Edit:

# What ports, IPs and protocols we listen for
Port 22

      



to

# What ports, IPs and protocols we listen for
Port 2222

      

Assuming you've followed everything else in the WSL setup tutorial from Microsoft. It will work.

According to @fnt in this link, port 22 is down because Microsoft has an SSH server broker running on that port.

+5


source







All Articles