ssh - Control socket does not exist - Operation timed out

天涯浪子 提交于 2020-06-27 17:28:05

问题


When I try to SSH on to my remote desktop from my Mac, I get this error message:

$ ssh -vvvv john@dev-dsk-john.com
OpenSSH_7.4p1, LibreSSL 2.5.0
debug1: Reading configuration data /Users/john/.ssh/config
debug1: /Users/john/.ssh/config line 26: Applying options for *
debug1: /Users/john/.ssh/config line 40: Applying options for dev-dsk*.amazon.com
debug1: /Users/john/.ssh/config line 165: Applying options for *.us-east-*.amazon.com
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: auto-mux: Trying existing master
debug1: Control socket "/tmp/ssh_mux_dev-dsk-john.com_22_john" does not exist
debug2: resolving "dev-dsk-john.com" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to dev-dsk-john.com [10.1.133.160] port 22.
debug1: connect to address 10.1.1.1 port 22: Operation timed out
ssh: connect to host dev-dsk-john.com port 22: Operation timed out

The connection hangs at "debug1: Connecting to dev-dsk-john.com [10.1.133.160] port 22."

It was working three days ago.

The system says the host is still active, so I'm pretty sure the computer is still powered on.


回答1:


I faced the same problem today, and finally managed to fixed it.

I first verified that the control socket really doesn't exist. My path was "/home/ethan/.ssh/controlmasters/ethan@a.b.c.d:22" and this didn't exist.

I then ran ssh like:

ssh -M -S /home/ethan/.ssh/controlmasters/ethan@<ipaddr>:22  server.example.org

Now, it connects and also creates the control socket. Subsequently, I could open another ssh and that didn't require password and things worked normally.




回答2:


I have a similar error, please try and change your permissions at /Users/john/.ssh/config these are system wide. If they're not 644 ec2 won't accept the connection. Same goes for your .pem key

Take a look Trying to SSH into an Amazon Ec2 instance - permission error



来源:https://stackoverflow.com/questions/43595294/ssh-control-socket-does-not-exist-operation-timed-out

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!