Unable to SSH into both remote & VM machine server

Unable to SSH into both remote & VM machine server


Getting the message
"fork failed: Resource temporarily unavailable"

"ssh_exchange_identification: Connection closed by remote host"

"ssh_exchange_identification: Connection closed by remote host"

"ssh_exchange_identification: Connection closed by remote host"



Please help.

MacBook Pro, OS X Mavericks (10.9), OSX10.9.5

Posted on Apr 8, 2015 5:16 AM

Reply
4 replies

Apr 8, 2015 6:39 AM in response to socialgenie

"fork failed: Resource temporarily unavailable"

I tend to get these when I have too many processes open on my computer and the operating system process table is full. With ssh in the mix, it could be coming from the local or the remote computer.


If you stop some processes on both systems (or try rebooting both system and trying the ssh right after reboot), maybe it will work.


Do you have a system where ssh does work. If you do, try an experiment with the working and the failing system:

ssh -v -v -v user@address.of.good.system

ssh -v -v -v user@address.of.failing.system

compare the output and see where the failing system gets off the rails. That is most likely the area of ssh that is running into problems. If the failing system never gets started, then the 'fork failed' is most likely happening on the local system.

Apr 10, 2015 1:51 AM in response to BobHarris

These are the processes currently running: from top command.
User uploaded file

These are the ulimit -a settings

User uploaded file

This is the output of trying to ssh into local Ubuntu VM (I am able to login here via VirtualBox interface)

$ssh -v -v -v spgen@192.168.1.11


OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011

debug1: Reading configuration data /Users/spgen/.ssh/config

debug1: /Users/spgen/.ssh/config line 1: Applying options for *

debug1: Reading configuration data /etc/ssh_config

debug1: /etc/ssh_config line 20: Applying options for *

debug1: /etc/ssh_config line 102: Applying options for *

debug2: ssh_connect: needpriv 0

debug1: Executing proxy command: exec ssh 10.0.2.15 -W 192.168.1.11:22

debug1: permanently_drop_suid: 501

debug1: identity file /Users/spgen/.ssh/id_rsa type -1

debug1: identity file /Users/spgen/.ssh/id_rsa-cert type -1

debug1: identity file /Users/spgen/.ssh/id_dsa type -1

debug1: identity file /Users/spgen/.ssh/id_dsa-cert type -1

debug1: Enabling compatibility mode for protocol 2.0

debug1: Local version string SSH-2.0-OpenSSH_6.2

fork failed: Resource temporarily unavailable

ssh_exchange_identification: Connection closed by remote host

ssh_exchange_identification: Connection closed by remote host

ssh_exchange_identification: Connection closed by remote host

----

This is the output of trying to SSH into remote AWS server. ( I am able to login through web interface here)

$ssh -v -v -v -i /Users/spgen/pem-files/123.pem spgen@54.94.230.41

OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011

debug1: Reading configuration data /Users/spg/.ssh/config

debug1: /Users/spgen/.ssh/config line 1: Applying options for *

debug1: Reading configuration data /etc/ssh_config

debug1: /etc/ssh_config line 20: Applying options for *

debug1: /etc/ssh_config line 102: Applying options for *

debug2: ssh_connect: needpriv 0

debug1: Executing proxy command: exec ssh 10.0.2.15 -W 54.94.230.41:22

debug3: Incorrect RSA1 identifier

debug1: permanently_drop_suid: 501

debug3: Could not load "/Users/spgen/pem-files/123.pem" as a RSA1 public key

debug1: identity file /Users/spgen/pem-files/123.pem type -1

debug1: identity file /Users/spgen/pem-files/123.pem-cert type -1

debug1: Enabling compatibility mode for protocol 2.0

debug1: Local version string SSH-2.0-OpenSSH_6.2

fork failed: Resource temporarily unavailable

ssh_exchange_identification: Connection closed by remote host

ssh_exchange_identification: Connection closed by remote host

ssh_exchange_identification: Connection closed by remote host"

---


I guess the processes is not the issue, but maybe something to do with ssh config files.
As you rightly guessed 'fork failed' is happening on the local system. Would appreciate any pointers.





TIA.

Apr 10, 2015 6:18 AM in response to socialgenie

top is not showing you all the processes. 'ps ax' would do better.


But looking at your ssh -v -v -v output, there may be a 3rd system in your loop

debug1: Executing proxy command: exec ssh 10.0.2.15 -W 54.94.230.41:22

Which seems to say first your ssh is going to be sent to 10.0.2.15, and from there the connection will be made to 54.94.230.41 (you have a similar ssh proxy for the other ssh -v -v -v you posted).

I have nerver played with ssh proxies, so I do not know enough about them.

Anyway, it is possible your own Mac issued the "fork failed: Resource temporarily unavailable" is from your own system when trying to 'fork' (create a subprocess) to run the ssh 10.0.2.15 -W 54.94.230.41:22 command (less likely, but cannot rule it out), or when attempting to connect with the 10.0.2.15 system, it failed to create a subprocess to handle your ssh request, or when the 10.0.2.15 system connected with 54.94.230.41, 54.94.230.41 failed to create a subprocess to handle your request.

Since you are getting the "fork failed: Resource temporarily unavailable" for 2 different systems, but BOTH of them are going through 10.0.2.15, I would suspect that there are problems with 10.0.2.15 not having enough process slots to handle the request.

Or perhaps 10.0.2.15 does not exist where you are, and you are just getting a failed connection.

A 10.*.*.* address is often used by companies inside their corporate firewall, so I'm wondering if your Mac has ssh config files setup by your company to use this proxy server.

Can you ping 10.0.2.15?

Can you nslookup 10.0.2.15?

Can you ssh localhost (ssh to yourself)? Is the ssh -v -v -v localhost showing the ssh proxy too?

Do you have stuff that might be forcing the 10.0.2.15 -W behavior in your .ssh/config

or /etc/ssh_config

or /etc/sshd_config (less likely as this is for ssh connections to your system, not for connections you are making from your system).

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Unable to SSH into both remote & VM machine server

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.