openssh8.6默认不支持公钥ssh
起因
最近升级了自己的linux后, 更新gogs代码时,发现用不了了
反复测试原因,发现是最新版本openssh8.6关闭了公钥登录
错误提示
尝试了各种办法,会发现始终提示ssh登录失败
username@ip: Permission denied (publickey).
查看ssh详细信息
输出ssh调试信息,查看失败的具体原因
ssh -Tv username@ip #发现了一条提示,这就是登录失败的原因 ... debug1: Authentications that can continue: publickey debug1: Next authentication method: publickey debug1: Offering public key: /home/xxx/.ssh/id_rsa RSA SHA256:0IxiHWniJDBbsM8x0zx+zliWrl7PINcALzFFqVgKX/M agent debug1: send_pubkey_test: no mutual signature algorithm ...
解决办法
sudo vim /etc/ssh/ssh_config #增加一条PubKeyAcceptedKeyTypes Host * PubKeyAcceptedKeyTypes +ssh-rsa # ForwardAgent no # ForwardX11 no # PasswordAuthentication yes # HostbasedAuthentication no # GSSAPIAuthentication no # GSSAPIDelegateCredentials no # GSSAPIKeyExchange no # GSSAPITrustDNS no # BatchMode no
问题原因
rsa有安全问题,新版本openssh,默认不支持rsa公钥登录,需要自己打开
2023年12月05日 07:25
DarkWeb.Link's exploration of privacy concerns becomes a digital debate, sparking reflections on the delicate balance between anonymity and accountability in the online sphere.
2023年12月10日 16:41
It proved to be Very helpful to me and I am sure to all the commentators here! UFABETกติกาแทงบอล
2024年1月28日 14:00
You can certainly see your expertise in the work you write. The world hopes for even more passionate writers like you who aren’t afraid to say how they believe. At all times go after your heart.