SSH公钥authentication问题

可能重复:
SSH密钥交换不起作用

在服务器A:我做了以下步骤:

ssh-keygen –t rsa cd /.ssh cp id_rsa.pub authorized_keys 

然后在服务器B中:我创build了.ssh目录,并从服务器A上载了authorized_keys

我尝试从服务器Alogin到服务器B,但系统仍然提示我input密码。

任何人都可以build议吗? 下面是使用下面的命令时得到的输出:

 ssh -v -o PreferredAuthentications=publickey user@host debug1: Next authentication method: publickey debug1: Trying private key: /export/home/user/.ssh/identity debug1: Trying public key: /export/home/user/.ssh/id_rsa debug1: Authentications that can continue: gssapi-keyex,gssapi-with-mic,publicke y,password,keyboard-interactive debug1: Trying private key: /export/home/user/.ssh/id_dsa debug1: No more authentication methods to try. Permission denied (gssapi-keyex,gssapi-with-mic,publickey,password,keyboard-interactive). 

尝试命令

 ssh-copy-id user@machine 

它应该自动复制你的密钥。

检查服务器B上的authorized_keys文件的权限。它应该最多为644.检查.ssh目录上的权限,它们应该是700.检查authorized_keys文件是否属于绑定login的帐户。