我正在尝试配置我的SSH服务器,以要求用户拥有一个RSA密钥。为此,我将sshd_config中的设置设置为
RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile %h/.ssh/authorized_keys 和
# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no
# Change to no to disable tunnelled clear text passwords
PasswordAuthentication no和
UsePAM no然后,我执行sudo /etc/init.d/ssh restart重新启动服务器。
这在某种程度上是可行的,因为我包含了我的macs rsa_key,它允许我登录而不需要密码。然而,当我试图通过一台没有包含密匙的计算机进入ssh时,它只会提示我输入密码,然后在输入时让我进去。
我做错了什么?
发布于 2013-11-13 23:50:29
我认为您没有正确地重新加载ssh配置。您使用的是哪个Linux发行版/版本(假设您使用的是Linux)?
在Ubuntu,我通常这样做:
sudo restart ssh
OR
sudo service ssh restart此外,尽管与这个问题无关--理想情况下,root不应该有密码--但您应该使用be use sudo。
发布于 2013-11-13 19:29:40
我觉得你也需要
ChallengeResponseAuthentication no
UsePAM no
PermitRootLogin without-password否则,即使sshd不要求自己提供密码,它也会信任PAM和login,后者将使用其密码对用户进行身份验证。
在测试时,请确保有另一种方法,以防SSH出现问题.并确保使用/etc/init.d/sshd restart重新启动服务器。
https://stackoverflow.com/questions/19962488
复制相似问题