我们有一个服务器,您可以ssh到它。但是,我们设置了公共加密密钥。我们希望登录的唯一方法是通过身份验证的密钥。无法使用密码登录。有办法做到这一点吗?
编辑:passwd -l account
似乎使得没有SSH密钥就无法登录帐户
设置sshd_config
中所有其他认证类型为no
RSAAuthentication no
PasswordAuthentication no
UsePAM no
KerberosAuthentication no
GSSAPIAuthentication no
您可以尝试将PasswordAuthentication no
行添加到/etc/ssh/sshd_config。可能取决于操作系统