![ssh 登录后崩溃](https://linux22.com/image/1105993/ssh%20%E7%99%BB%E5%BD%95%E5%90%8E%E5%B4%A9%E6%BA%83.png)
不幸的是,登录后 ssh 挂断了。已经卸载并重新安装。我可以通过删除 ~/.ssh 并注销并再次登录系统来暂时解决此问题。
这是我的 ssh -v 转储:
OpenSSH_5.8p1 Debian-7ubuntu1, OpenSSL 1.0.0e 6 Sep 2011
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to host [ip] port 22.
debug1: Connection established.
debug1: identity file /home/<user>/.ssh/id_rsa type -1
debug1: identity file /home/<user>/.ssh/id_rsa-cert type -1
debug1: identity file /home/<user>/.ssh/id_dsa type -1
debug1: identity file /home/<user>/.ssh/id_dsa-cert type -1
debug1: identity file /home/<user>/.ssh/id_ecdsa type -1
debug1: identity file /home/<user>/.ssh/id_ecdsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.5p1 Debian-6
debug1: match: OpenSSH_5.5p1 Debian-6 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.8p1 Debian-7ubuntu1
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Server host key: <key>
debug1: Host 'host' is known and matches the RSA host key.
debug1: Found key in /home/<user>/.ssh/known_hosts:1
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Trying private key: /home/<user>/.ssh/id_rsa
debug1: Trying private key: /home/<user>/.ssh/id_dsa
debug1: Trying private key: /home/<user>/.ssh/id_ecdsa
debug1: Next authentication method: password
user@host's password:
debug1: Authentication succeeded (password).
Authenticated to host ([ip]:22).
debug1: channel 0: new [client-session]
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LC_MESSAGES = de_DE.UTF-8
debug1: Sending env LC_COLLATE = de_DE.UTF-8
debug1: Sending env LANG = de_DE.UTF-8
debug1: Sending env LC_CTYPE = de_DE.UTF-8
有人知道吗?因为我完全不知道……
提前致谢
编辑:我还想说一下,终端似乎完全挂断了,因为 Ctrl + C 或 Ctrl + X 不起作用。
EDIT2:我也尝试了 ssh -v host ls,并且转储看起来完全相同,只是
debug1: Sending command: ls
在最后。
答案1
我终于找到了问题所在——是 wlan-router/dsl-modem 组合损坏了。换了新的路由器和调制解调器后,一切正常。
答案2
strace ssh ...
当系统看似挂起时,尝试运行以确定系统正在做什么。
(请注意,strace 输出包含您的密码,因此请不要在未仔细编辑的情况下发布它。)