WSL: Can't connect to server via ssh - Resource temporarily unavailable
This a reopening / copy from “Can’t connect to server via ssh #809” - https://github.com/Microsoft/BashOnWindows/issues/809#issuecomment-312420698
If you watch the last comments you can see that the problem isn’t fixed:
same here:
ssh -v root@192.168.0.7 OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 19: Applying options for * debug1: Connecting to 192.168.0.7 [192.168.0.7] port 22. debug1: connect to address 192.168.0.7 port 22: Resource temporarily unavailable ssh: connect to host 192.168.0.7 port 22: Resource temporarily unavailable
This is trying to connect to a machine on my home network.
But if i try to ssh to a linux virtual machine running on my PC, it works and it connects without any issues:
ssh -v root@192.168.168.129 OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 19: Applying options for * debug1: Connecting to 192.168.168.129 [192.168.168.129] port 22. debug1: Connection established. debug1: identity file /home/xxx/.ssh/id_rsa type -1 debug1: identity file /home/xxx/.ssh/id_rsa-cert type -1 debug1: identity file /home/xxx/.ssh/id_dsa type -1 debug1: identity file /home/xxx/.ssh/id_dsa-cert type -1 debug1: identity file /home/xxx/.ssh/id_ecdsa type -1 debug1: identity file /home/xxx/.ssh/id_ecdsa-cert type -1 debug1: identity file /home/xxx/.ssh/id_ed25519 type -1 debug1: identity file /home/xxx/.ssh/id_ed25519-cert type -1 debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.8 debug1: Remote protocol version 2.0, remote software version OpenSSH_7.2p2 Ubuntu-4ubuntu2.2 debug1: match: OpenSSH_7.2p2 Ubuntu-4ubuntu2.2 pat OpenSSH* compat 0x04000000 debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: server->client aes128-ctr hmac-sha1-etm@openssh.com none debug1: kex: client->server aes128-ctr hmac-sha1-etm@openssh.com none debug1: sending SSH2_MSG_KEX_ECDH_INIT debug1: expecting SSH2_MSG_KEX_ECDH_REPLY debug1: Server host key: ECDSA 28:59:dc:aa:da:d5:af:39:7a:82:88:23:b7:11:f9:f7 debug1: Host ‘192.168.168.129’ is known and matches the ECDSA host key. debug1: Found key in /home/dave/.ssh/known_hosts:1 debug1: ssh_ecdsa_verify: signature correct debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug1: SSH2_MSG_NEWKEYS received debug1: SSH2_MSG_SERVICE_REQUEST sent debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey,password debug1: Next authentication method: publickey debug1: Trying private key: /home/xxx/.ssh/id_rsa debug1: Trying private key: /home/dxxxave/.ssh/id_dsa debug1: Trying private key: /home/xxx/.ssh/id_ecdsa debug1: Trying private key: /home/xxx/.ssh/id_ed25519 debug1: Next authentication method: password rootdebug1: Authentication succeeded (password). Authenticated to 192.168.168.129 ([192.168.168.129]:22). debug1: channel 0: new [client-session] debug1: Requesting no-more-sessions@openssh.com debug1: Entering interactive session. debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0 debug1: Sending environment. debug1: Sending env LANG = it_IT.UTF-8 debug1: Sending env LC_CTYPE = it_IT.UTF-8 Welcome to Ubuntu 16.04.2 LTS (GNU/Linux 4.4.0-62-generic x86_64)
Documentation: https://help.ubuntu.com Management: https://landscape.canonical.com Support: https://ubuntu.com/advantage Last login: Sat Jul 1 10:56:55 2017 from 192.168.168.1
I got the same issue:
OpenSSH_7.2p2 Ubuntu-4ubuntu2.1, OpenSSL 1.0.2g 1 Mar 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to wurstbanane [192.168.1.132] port 22.
debug1: connect to address 192.168.1.132 port 22: Resource temporarily unavailable
ssh: connect to host wurstbanane port 22: Resource temporarily unavailable
There are multiple people in the old issue posting the same problem. I tried git bash, cgywin, bitverise and Filezilla which all connect without a problem. I tried reinstalling BashOnWindows, nothing works.
If you need some logs etc. I could provide them and help.
Thank you.
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Reactions: 25
- Comments: 35 (8 by maintainers)
I’m so stupid. I just had this problem because I installed Nginx in the server and it blocks SSH by default. You have to
sudo ufw allow sshAdding a windows firewall rule worked for me. Basically you need to tell the firewall to allow the port you use for ssh. Configurations you need to do are similar to this.
@sxhexe Thanks for the insight. Worked for me as well. I added an outbound rule for port 22.
All: If you’re trying to ssh into an sshd “server” running in WSL, you’ll likely hit the “port 22: Resource temporarily unavailable” error if:
@WurstCommander - your first example, where you see this error when trying to access a machine on your network is most likely caused by the firewall on that machine blocking access to port 22. Your second example, of being able to connect to ssdh running on a Linux VM on your local machine is because that Linux instance isn’t running a firewall, or the installed firewall exposes port 22 to the public network.
You can list the ports open on your WSL “server” by running
netstat -afrom PowerShell/Cmd and looking for open port 22I’ll write up some instructions and additional info on this scenario on our blog (https://blogs.msdn.microsoft.com/commandline) as it seems to be causing problems.
Hi all, Maybe someone helps me to fix this issue: I tried to connect via ssh in Ubuntu(WSL) but I got the following error:
OpenSSH_8.2p1 Ubuntu-4ubuntu0.2, 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 10.1.1.9 [10.1.1.9] port 22. debug1: connect to address 10.1.1.9 port 22: Resource temporarily unavailable ssh: connect to host 10.1.1.9 port 22: Resource temporarily unavailable
Then I tried to disable ufw or open it for port 22 : but I got the following error: sudo ufw allow 22/tcp WARN: initcaps [Errno 2] iptables v1.8.4 (legacy): can’t initialize iptables table `filter’: Table does not exist (do you need to insmod?) Perhaps iptables or your kernel needs to be upgraded.
and
sudo ufw status [sudo] password for sara: ERROR: problem running iptables: iptables v1.8.4 (legacy): can’t initialize iptables table `filter’: Table does not exist (do you need to insmod?) Perhaps iptables or your kernel needs to be upgraded.
I have upgraded the kernel fully but I got same error again: sudo iptables -L iptables v1.8.4 (legacy): can’t initialize iptables table `filter’: Table does not exist (do you need to insmod?) Perhaps iptables or your kernel needs to be upgraded.
** we use an open VPN credential to connect and my system ssh public key has been set on the server.
many thanks, Sara.
sshalways gives me a port 22 timeout/error on both WSL and PowerShell.Maybe it’s not a Windows thing? Idk. The only time I’ve been able to ssh into another machine is when that machine was a virtual machine in VirtualBox.
I received a “Resource temporarily unavailable” error because my subnet did not have a route to an Internet Gateway
do this:
sudo ufw allow sshor if you wanna be specific on ssh port(22) dosudo ufw allow 22. To check if firewall added properly:sudo ufw status.This thing actually happens when you do
sudo ufw enableand forget to add assh or port 22firewall.Hey Arjun: It’s very difficult to provide assistance with zero details about your environment, what you’re seeing, repro steps, etc.
Also, please don’t comment on closed threads - there are several other open VPN & SSH threads that’re likely to get more attention. If none of these describe your scenario, please file a new issue with as much info as you can. Thanks.
/cc @craigloewen-msft
I like that this is still a problem.
thisisfine.gif
@sunilmut No worries it’s solved. The issue is parallel to the original issue; I was unable to SSH into a WSL server using public ip instead of local ip.
This is likely a ISP or setup problem not a WSL bug and it is the ISP’s rental equipments.
I had the same problem (logging onto a VM running ubuntu) because I had prematurely added an entry in $HOME/.ssh/config allowing IdentitiesOnly as login on my local machine. However, the pub key had not been added to .ssh/authorized_keys, yet.
So, setting IdentitiesOnly to false, then using ssh-copy-id and finally login worked.
I was having the same problem Win 10 Pro insider preview build 16281. I had SSH working fine for logging into our Esxi Shell, and out of no where it was giving the same error, but like @alenmeister I added rule to firewall for port 22 and that cured my issue. Thanks for the feed back.