Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WSL2 cannot SSH to any servers #8018

Closed
1 of 2 tasks
hockeybrad opened this issue Feb 3, 2022 · 4 comments
Closed
1 of 2 tasks

WSL2 cannot SSH to any servers #8018

hockeybrad opened this issue Feb 3, 2022 · 4 comments

Comments

@hockeybrad
Copy link

Version

Microsoft Windows [Version 10.0.19043.1466]

WSL Version

  • WSL 2
  • WSL 1

Kernel Version

5.10.16

Distro Version

Ubuntu 20.04

Other Software

No response

Repro Steps

ssh userid@IPaddress
OpenSSH_8.2p1 Ubuntu-4, OpenSSL 1.1.1f 31 Mar 2020
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug1: Connecting to xx.xxx.xx.220 [xx.xxx.xx.220] port 22.
debug1: connect to address xx.xxx.xx.220 port 22: Connection timed out
ssh: connect to host xx.xxx.xx.220 port 22: Connection timed out

I can ssh from a VirutalBox VM running CentOS, and I can ssh from a simple command line (cmd) with this command. I expect if I installed any other ssh client it would work. It just doesn't work in WSL2.

After reading many pages of forums, I added a rule for incoming port 22 connections to the windows firewall. That didn't work so I just turned the whole firewall off and the ssh command still doesn't work. I don't think it's windows firewall preventing this. I do have Sophos Safeguard on this machine but am not able to detect if it has another layer of network protection. I will ask my company about this.

Expected Behavior

I am expecting a successful ssh connection.

Actual Behavior

ssh: connect to host xx.xxx.xx.220 port 22: Connection timed out

Diagnostic Logs

No response

@saade
Copy link

saade commented Feb 5, 2022

same here

@badr-ou
Copy link

badr-ou commented Feb 7, 2022

I had the same problem and it was because of the network, I solved it by following this solution :

Open command prompt as an administrator and type these

netsh winsock reset
netsh int ip reset all
netsh winhttp reset proxy
ipconfig /flushdns

Reboot your machine.

@OneBlue
Copy link
Collaborator

OneBlue commented Feb 8, 2022

Thanks for reporting this @hockeybrad. Does the command also time out if use ssh.exe on Windows ?

Are you trying to connect to a local ip address ?

@ghost
Copy link

ghost commented Feb 15, 2022

This issue has been automatically closed since it has not had any author activity for the past 7 days. If you're still experiencing this issue please re-open it.

Thank you!

@brainandforce brainandforce mentioned this issue Nov 14, 2022
2 tasks
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants