太原网站建设哪家最好,有哪些网站可以做代理,帝国cms转换wordpress,丰城网站建设公司上一篇“【OpenSSH升级】无论密码输入正确与否总是登录失败#xff08;error: Could not get shadow information for root#xff09;”总结了CentOS7上的openssh从7.4升级到9.4之后#xff0c;密码认证失败问题#xff0c;这里再总结一下证书认证失效问题。
大多数情况下…上一篇“【OpenSSH升级】无论密码输入正确与否总是登录失败error: Could not get shadow information for root”总结了CentOS7上的openssh从7.4升级到9.4之后密码认证失败问题这里再总结一下证书认证失效问题。
大多数情况下可能遇不到这个问题因为我将root用户锁了也就是密码肯定用不了然后sshd_config配置为证书和密码认证均可
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keysPasswordAuthentication yes
突然发现证书认证失效了还以为是如下问题便使用ssh-ed25519重新生成秘钥进行配置但是仍然无法成功登录 高版本openssh PublicKey加密算法问题
1、使用ssh-rsa加密算法报错 userauth_pubkey: key type ssh-rsa not in PubkeyAcceptedAlgorithms [preauth] 2、网上很多说在sshd_config中配置中增加ssh-rsa的支持但是并不生效 PubkeyAcceptedAlgorithms ssh-rsa
解决使用加密算法默认生成到~/.ssh ssh-keygen -t ssh-ed25519 cat id_ed25519.pub authorized_keys 将id_ed25519下载到客户端进行配置。以securecrt为例 新建会话右键Properties-SSH2-Authentication-PublicKey(选中)-Properties右侧Public Key Properties的弹出面板中选则“Use session public key setting”下方选择下载到客户端本地的Public Key 文件。 最后只能查看查看系统日志遇到问题直接查看问题日志而不是瞎猜 ---此乃解决问题的金科玉律
2023-12-01T16:40:10.37153108:00|info|sshd[2517662]|User root not allowed because account is locked 2023-12-01T16:40:10.61775008:00|info|sshd[2517662]|userauth_pubkey: signature algorithm ssh-rsa not in PubkeyAcceptedAlgorithms [preauth] 2023-12-01T16:40:16.47231608:00|err|sshd[2517662]|error: Could not get shadow information for NOUSER 2023-12-01T16:40:16.49878608:00|info|sshd[2517662]|Failed password for invalid user root from 192.168.xx.xxx port 22123 ssh2 2023-12-01T16:40:18.34679208:00|err|sshd[2517662]|error: Received disconnect from 192.168.14.103 port 22123:14: Unable to authenticate using any of the configured authentication methods. [preauth] 2023-12-01T16:40:18.34708608:00|info|sshd[2517662]|Disconnected from invalid user root 192.168.14.103 port 22123 [preauth]
上述日志一眼开门的解释果断解锁root用户usermod -U root再次登录认证成功。