Author: fbysss
QQ: Wine bar Bar I scattered
Blog:blog.csdn.net/fbysss
Disclaimer: This article by fbysss original, reproduced please indicate the source
problem: connect to server, before all good, suddenly error: Shared connection to xxx.xxx.xxx.xxx closed.
background: Client for Mac Pro,term 2, configured with ~/.ssh/config
Troubleshooting:
1. Try other tools, too. But the hints are not quite the same. For example SECURECRT directly did not respond, Xshell hint A and X11 related east, estimate are crooked floor.
2. It was discovered that Root could be connected. Creates a new user or can connect from a client.
3. Try the server switch to SSS user su-sss, an error message appears: Su:failed to Execute/bin/bash: resource temporarily unavailable
Vi/etc/security/limits.d/20-nproc.conf the number of the first line is 4096, followed by a 0 plus. Then, you can switch normally. 4. The client is still unable to connect. However, it is possible to annotate two sentences in the ~/.ssh/config. ============================== #ControlMaster Auto #ControlPath ~/.ssh/master-%r@%h:%p Of course, if the comment means that each time SSH has to enter the password again. Obviously not. Well. Analysis, it is estimated that the previous connection has a problem, but also persistent, and then the connection will use a bad connection.
5. So, PS aux |grep master, found a connection, that is, just try to unsuccessful connection. SSS 8223 0.0 0.0 2471520 684?? Ss 12:07 pm 0:00.00 ssh:/users/sss/.ssh/master-sss@xxx.xxx.xxx.xxx:22 [MUX]
Kill-9 8223 Remove the comment and then connect again, OK. Summary: The above approach temporarily solves the problem, but the root cause needs to be further identified. But from the earliest error hints, to direct answers it is really hard to get directly, so record and share.