Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将SSH设置为仅使用密钥,而不使用密码_Ssh - Fatal编程技术网

将SSH设置为仅使用密钥,而不使用密码

将SSH设置为仅使用密钥,而不使用密码,ssh,Ssh,我们有一个服务器,你可以用ssh连接到它。但是,我们设置了公共加密密钥。我们希望登录的唯一方法是使用经过身份验证的密钥。无法使用密码登录。有办法做到这一点吗 编辑: passwd -l account 似乎无法在没有ssh密钥的情况下登录帐户。您可以尝试在/etc/ssh/sshd\u config中添加行密码身份验证号。可能取决于操作系统在sshd\u config中设置所有其他身份验证类型no RSAAuthentication no PasswordAuthentication no U

我们有一个服务器,你可以用ssh连接到它。但是,我们设置了公共加密密钥。我们希望登录的唯一方法是使用经过身份验证的密钥。无法使用密码登录。有办法做到这一点吗

编辑:

passwd -l account

似乎无法在没有ssh密钥的情况下登录帐户。

您可以尝试在/etc/ssh/sshd\u config中添加行
密码身份验证号。可能取决于操作系统在
sshd\u config
中设置所有其他身份验证类型
no

RSAAuthentication no
PasswordAuthentication no
UsePAM no
KerberosAuthentication no
GSSAPIAuthentication no