WSL icon indicating copy to clipboard operation
WSL copied to clipboard

Can't connect to SSH after logging out

Open Skalin opened this issue 10 years ago • 13 comments

After restarting a ssh session or logging out from it, I can't connect again because of this error message:

root@mcraft:/home/dir# logout
Connection to server.com closed.
skalin@SKALIN-NOTEBOOK:/mnt/c/Users/Dominik/Desktop$ ssh [email protected]
ssh: connect to host server.comport 22: Resource temporarily unavailable
skalin@SKALIN-NOTEBOOK:/mnt/c/Users/Dominik/Desktop$ ssh [email protected]
ssh: connect to host server.com port 22: Resource temporarily unavailable
skalin@SKALIN-NOTEBOOK:/mnt/c/Users/Dominik/Desktop$ ssh [email protected]
ssh: connect to host server.com port 22: Resource temporarily unavailable
skalin@SKALIN-NOTEBOOK:/mnt/c/Users/Dominik/Desktop$ ssh [email protected]
ssh: connect to host server.com port 22: Resource temporarily unavailable
skalin@SKALIN-NOTEBOOK:/mnt/c/Users/Dominik/Desktop$

The SSH on a server is running, I can connect via Putty without a problem. The problem occurs also when I use a root account. The only thing working to restore the availability to connect is to close the Bash windows where the system can't connect to ssh, then start it again and the ssh connection is working properly

Skalin avatar Aug 02 '16 21:08 Skalin

Could this be related to the rxvt problem reported by @manouchehri?

fpqc avatar Aug 03 '16 01:08 fpqc

Could you please provide a link to problem he reported? I am not able to find it.

Skalin avatar Aug 04 '16 17:08 Skalin

@Skalin look at @bitcrazed 's answer to #777 (@bitcrazed is like the team manager guy of the WSL/console team, iirc from an interview with him on channel 9)

I think this is what's happening to you.

fpqc avatar Aug 05 '16 17:08 fpqc

@Skalin - Can you please verify if this problem still exists in the latest insider build? There have been quite a few changes in the networking stack of WSL since this post.

sunilmut avatar Nov 21 '16 20:11 sunilmut

Closing the issue out because of inactivity. If the issue persists, please re-open or ping the thread and we will gladly re-open.

sunilmut avatar Dec 04 '16 10:12 sunilmut

Just had

ssh: connect to host ###.###.###.### port 22: Resource temporarily unavailable

After: sudo ssh root@###.###.###.### -L 22:localhost:22 -L 2222:localhost:8080 -i /mnt/c/PRIVATE_KEY_LOCATION

It happened after about 2 months I didn't use the Desktop PC.

Totally reinstalling WSL didn't help.

I should note that I don't have any third party antivirus (AFAICR), so it's quite odd.

Please reopen @sunilmut

ghost avatar Mar 20 '17 06:03 ghost

It seems I was wrong. My VPS is down for some reason (I can't even access the sites from a browser neither to login from Putty or WinSCP). Yet I get the error "Resource temporarily unavailable" which I'm not sure is suitable for this problem.

In other words, @sunilmut @benhillis , the problem above is not WSL related, yet I'm really not sure I get the right error.

ghost avatar Mar 21 '17 09:03 ghost

This problem seems to be caused due to a bug in CSF-LFD as I am able to access the VPS from other IP numbers.

ghost avatar Mar 21 '17 13:03 ghost

I get

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

but I'm able to connect via putty without a problem at all.

WurstCommander avatar Jun 26 '17 16:06 WurstCommander

I am having a "Resource temporarily unavailable" error when trying to connect via ssh. Am not getting the problem when using putty. Please help, I don't want to download putty again ):

timdeng2324 avatar Aug 04 '17 22:08 timdeng2324

I was stumped by this. I ran a sudo apt update and it was cured. It was probably a problem inside a package.

micander avatar Aug 17 '17 23:08 micander

I got this same error on 10.0.16299.309, all I had to do to repo was:

  1. Connect to an ssh server.
  2. Close the session.
  3. Trying to open the session again would throw the ssh: connect to host domain.com port 22: Resource temporarily unavailable

In order to connect I was force to restart the Ubuntu shell.

A permanent solution that worked for me was adding the following lines in the ~/.ssh config file, as given in superuser by computergeek125:

Host *
    ProxyCommand nc %h %p %r

ghost avatar Mar 15 '18 15:03 ghost

@Skalin As per conversation on Twitter this morning, could you share your findings re. this is a known ssh issue on other platforms too?

bitcrazed avatar Apr 14 '18 00:04 bitcrazed