设置SSHD来处理多个密钥对

我试图设置我的sshd接受没有系统用户帐户的用户。 我的方法是使用DSA公钥/私钥对。

  1. 我生成了一个密钥对: $ ssh-keygen -t dsa
  2. 我将id_dsa.pub复制到sshd运行的服务器机器上。
  3. 我将id_dsa.pub的行添加到我将用于每个“外部”用户的单个现有系统用户帐户的〜/ .ssh / authorized_keys。
  4. 我试图ssh作为“外部”用户到我设置authorized_keys的机器,并惨败。

我在这里错过了什么?

谢谢。

可能是权限。

 $ chmod 700 ~/.ssh $ chmod 600 ~/.ssh/authorized_keys 

由于您只能使用puclic密钥身份validation,因此请修改服务器计算机中的/etc/ssh/sshd_config文件,如下所示:

 PubkeyAuthentication yes HostbasedAuthentication no ChallengeResponseAuthentication no GSSAPIAuthentication no PasswordAuthentication no 

重新启动sshd守护进程,你应该没问题。