问题背景:在使用Tabby的跳板机方式登录Ubuntu 22系统时,出现拒绝情况,报错如下:

Tabby报错:

 SSH  Connecting to oracle-152.wanggaoli.com
 SSH  Host key fingerprint:
 SSH   ecdsa-sha2-nistp256  6OwhKcazstt0rGo42527AYsQb1OMeb4nSHD20XZL7lU= 
 SSH  Loading private key: file:///Users/wanggaoli/Documents/id_rsa
 X  All configured authentication methods failed
 SSH   X  Remote rejected opening a shell channel: Error: Not connected

系统auth.log报错:

Jun 19 11:39:17 oracle-91 sshd[4928]: userauth_pubkey: key type ssh-rsa not in PubkeyAcceptedAlgorithms [preauth]
Jun 19 11:39:18 oracle-91 sshd[4928]: Received disconnect from 123.57.130.158 port 19632:11:  [preauth]
Jun 19 11:39:18 oracle-91 sshd[4928]: Disconnected from authenticating user root 123.57.130.158 port 19632 [preauth]

解决方案:在sshd_config文件中,添加如下参数,并重启sshd后正常。

echo "PubkeyAcceptedKeyTypes=+ssh-rsa" >>/etc/ssh/sshd_config
systemctl restart sshd