-
Notifications
You must be signed in to change notification settings - Fork 796
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
Can't connect to server via ssh - Resource temporarily unavailable #2278
Comments
Might help if you add your windows version and what firewall / antivirus you use (if any) |
Windows 10 Pro Windows Defender and Windows Firewall, nothing else. |
@WurstCommander - Thanks for your post. If you can try couple of things and in the order and share your results, that would be great.
|
yeah it does (IP changed of the server)
I sadly just deinstalled bash for windows because it didn't work, maybe I'll get me motivated again :-) |
I see the same problem on two different WSL installations - both Windows 10 with all updates and the latest available WSL installed for this Windows version: Windows 10 Enterprise, Version 1703, OS Build 15063.483 Within bash, "uname -a" yields (replacing the node name here with "localnode") Also within bash, "lsb_release -a" yields I ran the strace command you requested. Output, edited to replace account and machine name details, is in the file attached. Hope this gives you enough to work on. |
The same story here. The problem started after I configured my Hassbian for a static IP. Nothing else changed, just rebooted my RPi - worked fine before reboot/reconfiguration, "Resource temporarily unavailable" after. |
@alansill thx for doing "my work". I just hadn't the time to reinstall bash for windows. |
Adding 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. |
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. |
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 I'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. |
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. |
use
but ssh can't establish connection
|
@Diluka Note that Linux binaries run atop WSL alongside Win32 process, and that both run ABOVE the firewall. This for traffic between Win32 and Linux processes on the same machine do not reach the Windows firewall & should be able to communicate relatively unhindered. If you're trying to ssh into a "remote" ssh server, you will need to ensure that the firewall in front of your ssh server has exposed the ssh server's port (22 in your example above) to the external network. Also, if you want to use shared key authentication, you'll need to register your client's SSH public key with your ssh server. |
solved it by reinstall openssh-server |
@Diluka Thanks for letting us know. @WurstCommander Could you please close this issue if your problem is resolved? |
Version: windows 10 home build 16299. Had same problem. I solved it, either because I had accidentally ssh'd with sudo or because reinstalled openssh-server (changed both, can't establish clear causation) |
Thanks @naefl. Hey @WurstCommander - can you confirm if this issue is now resolved, and close this issue if it is? |
UPDATE - SOLVED: Xfinity's provided rented modem/router was the issue. Highly recommend you to end that plan and get your own especially if you want a home server. While I am able to get localhost to work on ports 22 (and others), unfortunately, it doesn't work on when trying to connect through public IP. $ ssh [user]@localhost -p [port] # works
$ ssh [user]@10.0.0.2 -p [port] # works
$ ssh [user]@[public_ip] -p [port]
ssh: connect to host [public_ip] port [port]: Resource temporarily unavailable
I've gotten this to worked perfectly and was able to use my computer as a WAN-accessible server. However I've deleted WSL and redid everything now it doesn't work. Maybe things change in later Windows build? Windows Build: 17115 Sorry if I'm posting this in the wrong place, very similar issue so I didn't want to make another one. Lmk if I should. |
@ketozhang - Not sure I fully understand your setup. Are you trying to SSH into WSL or SSH'ing from WSL or both? If you can isolate this issue to WSL that would be helpful too i.e replace any WSL instance with a native Linux and see if it changes anything. |
@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. |
Reinstalling sshd (openssh-server) fixed this for me. No firewall changes required: apt-get remove openssh-server From the local Windows 10 Cygwin prompt: |
|
My issue was that the domain had been moved to cloud front and I needed to use the direct IP address instead of the domain name. |
I received a "Resource temporarily unavailable" error because my subnet did not have a route to an Internet Gateway |
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 |
I like that this is still a problem. thisisfine.gif |
@AleksandrHovhannisyan - sorry - what problem? ssh should work fine. |
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. |
@AleksandrHovhannisyan @bitcrazed Every time I update windows I have a problem with SSH to my ec2 instance. I tried most of the solutions in this issue and it still does not work. The solution that seemed to work for me the longest time was to add 8.8.8.8 as a NameServer in the /etc/resolv.conf file in WSL and this configuration had to be done everytime wsl is booted. This does not work for me since the latest update. Also its worth noting that I am connecting to my server through a VPN (which is a requisite). |
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. |
do this: This thing actually happens when you do |
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 Then I tried to disable ufw or open it for port 22 : but I got the following error: sudo ufw allow 22/tcp and sudo ufw status I have upgraded the kernel fully but I got same error again: sudo iptables -L ** we use an open VPN credential to connect and my system ssh public key has been set on the server. many thanks, |
I faced the same problem suddenly after ssh was working fine, then I found that windows made an update which affected my Hyper-V virtual switch configuration .. somehow after some trails I was able to fix it mainly by disabling and removing one of the Hyper-V virtual switches added after the windows update |
This is still a problem.
Checks so far:
Edit: corrected command view, added verbose output. |
This a reopening / copy from "Can't connect to server via ssh #809" - #809 (comment)
If you watch the last comments you can see that the problem isn't fixed:
I got the same issue:
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.
The text was updated successfully, but these errors were encountered: