今天在设置linux的免密码登陆后,仍然须要输入密码,后来找到了缘由,是由于用户没有权限修改.ssh目录下的know_hosts文件致使的。linux
具体状况是这样的:ssh
在/home/username/.ssh输入如下命令后:spa
#ssh-keygen -t rsa -P '' -f id_rsacode
#cat id_rsa.pub >> authorized_keysci
#ssh localhostit
出现下面命令
class
username@localhost ~ $ ssh localhost
The authenticity of host 'localhost
(::1)' can't be established.
RSA key fingerprint is 6e:6b:0f:2a:b8:91:3f:c8:f0:39:e4:df:b4:d8:16:6b.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'localhost
(::1)
' (RSA) to the list of known hosts.
username@localhost's password: