SSH认证成功后连接超时问题排查求助
SSH认证成功后连接超时问题排查求助
我现在遇到一个很头疼的SSH问题:我的Xubuntu电脑不管是从本地执行ssh localhost还是从其他远程主机连接,认证环节都显示成功,但之后直接超时,完全进不了交互会话。下面是我已经收集到的信息和做过的排查,希望能得到大家的帮助!
一、sshd debug3模式关键日志片段
我把sshd调到debug3模式,认证完成后的日志如下:
lug 08 11:56:15 huaweipc sshd[113871]: Accepted publickey for paolo from 127.0.0.1 port 37762 ssh2: ED25519 SHA256:T6Dhpm0IYGrxJqUHUR7I44gdnrbBnPVET/DRC6wxaOI lug 08 11:56:15 huaweipc sshd[113871]: debug1: monitor_child_preauth: user paolo authenticated by privileged process lug 08 11:56:15 huaweipc sshd[113871]: debug3: mm_get_keystate: Waiting for new keys lug 08 11:56:15 huaweipc sshd[113871]: debug3: mm_request_receive_expect: entering, type 26 lug 08 11:56:15 huaweipc sshd[113871]: debug3: mm_request_receive: entering lug 08 11:56:15 huaweipc sshd[113871]: debug3: mm_get_keystate: GOT new keys lug 08 11:56:15 huaweipc sshd[113871]: debug1: auth_activate_options: setting new authentication options [preauth] lug 08 11:56:15 huaweipc sshd[113871]: debug2: userauth_pubkey: authenticated 1 pkalg ssh-ed25519 [preauth] lug 08 11:56:15 huaweipc sshd[113871]: debug3: user_specific_delay: user specific delay 0.000ms [preauth] lug 08 11:56:15 huaweipc sshd[113871]: debug3: ensure_minimum_time_since: elapsed 7.204ms, delaying 6.530ms (requested 6.867ms) [preauth] lug 08 11:56:15 huaweipc sshd[113871]: debug3: mm_do_pam_account entering [preauth] lug 08 11:56:15 huaweipc sshd[113871]: debug3: mm_request_send: entering, type 102 [preauth] lug 08 11:56:15 huaweipc sshd[113871]: debug3: mm_request_receive_expect: entering, type 103 [preauth] lug 08 11:56:15 huaweipc sshd[113871]: debug3: mm_request_receive: entering [preauth] lug 08 11:56:15 huaweipc sshd[113871]: debug3: mm_do_pam_account returning 1 [preauth] lug 08 11:56:15 huaweipc sshd[113871]: debug3: send packet: type 52 [preauth] lug 08 11:56:15 huaweipc sshd[113871]: debug3: mm_request_send: entering, type 26 [preauth] lug 08 11:56:15 huaweipc sshd[113871]: debug3: mm_send_keystate: Finished sending state [preauth] lug 08 11:56:15 huaweipc sshd[113871]: debug1: monitor_read_log: child log fd closed lug 08 11:56:15 huaweipc sshd[113871]: debug3: ssh_sandbox_parent_finish: finished lug 08 11:56:15 huaweipc sshd[113871]: debug1: PAM: establishing credentials lug 08 11:56:15 huaweipc sshd[113871]: debug3: PAM: opening session lug 08 11:56:15 huaweipc sshd[113871]: debug2: do_pam_session: auth information in SSH_AUTH_INFO_0 lug 08 11:56:15 huaweipc sshd[113871]: pam_unix(sshd:session): session opened for user paolo(uid=1000) by (uid=0)
二、客户端verbose模式完整输出
执行ssh -vvv localhost后,认证成功后会每分钟重复输出debug3: send packet: type 80,连续3次后提示超时,全程没有交互界面,Ctrl+C也无法中断。完整日志如下:
$ ssh -vvv localhost OpenSSH_8.9p1 Ubuntu-3ubuntu0.1, OpenSSL 3.0.2 15 Mar 2022 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files debug1: /etc/ssh/ssh_config line 21: Applying options for * debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/home/paolo/.ssh/known_hosts' debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/home/paolo/.ssh/known_hosts2' debug2: resolving "localhost" port 22 debug3: resolve_host: lookup localhost:22 debug3: ssh_connect_direct: entering debug1: Connecting to localhost [127.0.0.1] port 22. debug3: set_sock_tos: set socket 3 IP_TOS 0x10 debug1: Connection established. debug1: identity file /home/paolo/.ssh/id_rsa type 0 debug1: identity file /home/paolo/.ssh/id_rsa-cert type -1 debug1: identity file /home/paolo/.ssh/id_ecdsa type -1 debug1: identity file /home/paolo/.ssh/id_ecdsa-cert type -1 debug1: identity file /home/paolo/.ssh/id_ecdsa_sk type -1 debug1: identity file /home/paolo/.ssh/id_ecdsa_sk-cert type -1 debug1: identity file /home/paolo/.ssh/id_ed25519 type 3 debug1: identity file /home/paolo/.ssh/id_ed25519-cert type -1 debug1: identity file /home/paolo/.ssh/id_ed25519_sk type -1 debug1: identity file /home/paolo/.ssh/id_ed25519_sk-cert type -1 debug1: identity file /home/paolo/.ssh/id_xmss type -1 debug1: identity file /home/paolo/.ssh/id_xmss-cert type -1 debug1: identity file /home/paolo/.ssh/id_dsa type -1 debug1: identity file /home/paolo/.ssh/id_dsa-cert type -1 debug1: Local version string SSH-2.0-OpenSSH_8.9p1 Ubuntu-3ubuntu0.1 debug1: Remote protocol version 2.0, remote software version OpenSSH_8.9p1 Ubuntu-3ubuntu0.1 debug1: compat_banner: match: OpenSSH_8.9p1 Ubuntu-3ubuntu0.1 pat OpenSSH* compat 0x04000000 debug2: fd 3 setting O_NONBLOCK debug1: Authenticating to localhost:22 as 'paolo' debug3: record_hostkey: found key type ED25519 in file /home/paolo/.ssh/known_hosts:38 debug3: load_hostkeys_file: loaded 1 keys from localhost debug1: load_hostkeys: fopen /home/paolo/.ssh/known_hosts2: No such file or directory debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory debug3: order_hostkeyalgs: have matching best-preference key type ssh-ed25519-cert-v01@openssh.com, using HostkeyAlgorithms verbatim debug3: send packet: type 20 debug1: SSH2_MSG_KEXINIT sent debug3: receive packet: type 20 debug1: SSH2_MSG_KEXINIT received debug2: local client KEXINIT proposal debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,sntrup761x25519-sha512@openssh.com,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,ext-info-c debug2: host key algorithms: ssh-ed25519-cert-v01@openssh.com,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,sk-ssh-ed25519-cert-v01@openssh.com,sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ssh-ed25519@openssh.com,sk-ecdsa-sha2-nistp256@openssh.com,rsa-sha2-512,rsa-sha2-256 debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1 debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1 debug2: compression ctos: none,zlib@openssh.com,zlib debug2: compression stoc: none,zlib@openssh.com,zlib debug2: languages ctos: debug2: languages stoc: debug2: first_kex_follows 0 debug2: reserved 0 debug2: peer server KEXINIT proposal debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,sntrup761x25519-sha512@openssh.com,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256 debug2: host key algorithms: rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519 debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1 debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1 debug2: compression ctos: none,zlib@openssh.com debug2: compression stoc: none,zlib@openssh.com debug2: languages ctos: debug2: languages stoc: debug2: first_kex_follows 0 debug2: reserved 0 debug1: kex: algorithm: curve25519-sha256 debug1: kex: host key algorithm: ssh-ed25519 debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none debug3: send packet: type 30 debug1: expecting SSH2_MSG_KEX_ECDH_REPLY debug3: receive packet: type 31 debug1: SSH2_MSG_KEX_ECDH_REPLY received debug1: Server host key: ssh-ed25519 SHA256:PlciRlNWPOvPo2QAexfRn+Le/6tfdKK0RsFbqLsVsNs debug3: record_hostkey: found key type ED25519 in file /home/paolo/.ssh/known_hosts:38 debug3: load_hostkeys_file: loaded 1 keys from localhost debug1: load_hostkeys: fopen /home/paolo/.ssh/known_hosts2: No such file or directory debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory debug1: Host 'localhost' is known and matches the ED25519 host key. debug1: Found key in /home/paolo/.ssh
相关产品推荐
相关产品推荐

