@
twofox 使用公钥认证时的 sshd log 应该长这样,这是客户端等待输入用户时的
···
Aug 8 08:50:14 sakuramoyu sshd[2885479]: debug3: fd 5 is not O_NONBLOCK
Aug 8 08:50:14 sakuramoyu sshd[2885479]: debug1: Forked child 2885502.
Aug 8 08:50:14 sakuramoyu sshd[2885479]: debug3: send_rexec_state: entering fd = 8 config len 3256
Aug 8 08:50:14 sakuramoyu sshd[2885479]: debug3: ssh_msg_send: type 0
Aug 8 08:50:14 sakuramoyu sshd[2885479]: debug3: send_rexec_state: done
Aug 8 08:50:14 sakuramoyu sshd[2885502]: debug3: oom_adjust_restore
Aug 8 08:50:14 sakuramoyu sshd[2885502]: debug1: Set /proc/self/oom_score_adj to 0
Aug 8 08:50:14 sakuramoyu sshd[2885502]: debug1: rexec start in 5 out 5 newsock 5 pipe 7 sock 8
Aug 8 08:50:14 sakuramoyu sshd[2885502]: debug1: inetd sockets after dupping: 4, 4
Aug 8 08:50:14 sakuramoyu sshd[2885502]: Connection from 10.1.122.254 port 59841 on 10.1.123.123 port 22 rdomain ""
Aug 8 08:50:14 sakuramoyu sshd[2885502]: debug1: Local version string SSH-2.0-OpenSSH_8.9p1 Ubuntu-3ubuntu0.3
Aug 8 08:50:14 sakuramoyu sshd[2885502]: debug1: Remote protocol version 2.0, remote software version PuTTY_Release_0.77
Aug 8 08:50:14 sakuramoyu sshd[2885502]: debug1: compat_banner: no match: PuTTY_Release_0.77
Aug 8 08:50:14 sakuramoyu sshd[2885502]: debug2: fd 4 setting O_NONBLOCK
Aug 8 08:50:14 sakuramoyu sshd[2885502]: debug3: ssh_sandbox_init: preparing seccomp filter sandbox
Aug 8 08:50:14 sakuramoyu sshd[2885502]: debug2: Network child is on pid 2885503
Aug 8 08:50:14 sakuramoyu sshd[2885502]: debug3: preauth child monitor started
Aug 8 08:50:14 sakuramoyu sshd[2885502]: debug3: privsep user:group 106:65534 [preauth]
Aug 8 08:50:14 sakuramoyu sshd[2885502]: debug1: permanently_set_uid: 106/65534 [preauth]
Aug 8 08:50:14 sakuramoyu sshd[2885502]: debug3: ssh_sandbox_child: setting PR_SET_NO_NEW_PRIVS [preauth]
Aug 8 08:50:14 sakuramoyu sshd[2885502]: debug3: ssh_sandbox_child: attaching seccomp filter program [preauth]
Aug 8 08:50:14 sakuramoyu sshd[2885502]: debug3: append_hostkey_type: ssh-rsa key not permitted by HostkeyAlgorithms [preauth]
Aug 8 08:50:14 sakuramoyu sshd[2885502]: debug1: list_hostkey_types: rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519 [preauth]
Aug 8 08:50:14 sakuramoyu sshd[2885502]: debug3: send packet: type 20 [preauth]
Aug 8 08:50:14 sakuramoyu sshd[2885502]: debug1: SSH2_MSG_KEXINIT sent [preauth]
Aug 8 08:50:14 sakuramoyu sshd[2885502]: debug3: receive packet: type 20 [preauth]
Aug 8 08:50:14 sakuramoyu sshd[2885502]: debug1: SSH2_MSG_KEXINIT received [preauth]
Aug 8 08:50:14 sakuramoyu sshd[2885502]: debug2: local server KEXINIT proposal [preauth]
Aug 8 08:50:14 sakuramoyu sshd[2885502]: debug2: KEX algorithms: curve25519-sha256,
[email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
[email protected],diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hel
lman-group18-sha512,diffie-hellman-group14-sha256 [preauth]
Aug 8 08:50:14 sakuramoyu sshd[2885502]: debug2: host key algorithms: rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519 [preauth]
···
可以看出我是使用`putty`连接的,下面有`HostKeyAlgorithms`不允许`ssh-rsa`这种类型
如果你的 SSH log 没有类似于上面的,可以考虑是不是输错了地址(连到别人的 SSH 上了也不是没这个可能)或者是直接被防火墙拦截了