无密码ssh登录到同一个linux服务器

时间:2014-10-16 05:13:10

标签: linux login ssh

我需要使用ssh进行无密码登录到同一台服务器。 我以前在同一台服务器上完成了这项工作,但它已经有效了。

cd ~
ssh-keygen -t dsa

cd ~/.ssh/
ssh-copy-id -i   id_dsa   <user@target-system>

我使用了上面显示的步骤。

我现在正在尝试并遵循所有可能的解决方案,但它无法正常工作。

当我在debug模式下运行ssh时,我收到以下错误/警告:

 debug1: Unspecified GSS failure.  Minor code may provide more information
 No credentials cache found

 debug1: Unspecified GSS failure.  Minor code may provide more information
 No credentials cache found

 debug1: Unspecified GSS failure.  Minor code may provide more information
 No credentials cache found

有人可以为此提供帮助吗?

现在,每当我尝试ssh时,都会提示输入密码。

1 个答案:

答案 0 :(得分:-1)

目标主机上$HOME/.ssh上可能存在权限问题。

验证检查是否与

相似
sshd[1235]: Authentication refused: bad ownership or modes for directory /home/someuser

出现在目标主机的authlog(如果是Debian / Ubuntu的/var/log/auth.log)中。

如果是,请在目标主机上执行以下操作,并尝试登录

chmod o-w ~/
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys