日期:2014-05-16  浏览次数:21113 次

ssh密码正确,但无法登录
这个问题困扰我很久了.
最开始的时候出现的提示是:
yaya@ubuntu:~/.ssh$ ssh fangfei@211.69.198.211
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
41:17:80:61:b5:6f:2d:a1:10:dd:b8:ef:25:5d:03:50.
Please contact your system administrator.
Add correct host key in /home/yaya/.ssh/known_hosts to get rid of this message.
Offending RSA key in /home/yaya/.ssh/known_hosts:3
  remove with: ssh-keygen -f "/home/yaya/.ssh/known_hosts" -R 211.69.198.211
RSA host key for 211.69.198.211 has changed and you have requested strict checking.
Host key verification failed.


于是按照网上的答案,将know_hosts里的第3行去掉.再连就会出现
yaya@ubuntu:~/.ssh$ ssh fangfei@211.69.198.211
The authenticity of host '211.69.198.211 (211.69.198.211)' can't be established.
RSA key fingerprint is 41:17:80:61:b5:6f:2d:a1:10:dd:b8:ef:25:5d:03:50.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '211.69.198.211' (RSA) to the list of known hosts.
Password: (正常情况下应该出来的提示是fangfei@211.69.198.211's password:)

接着输入正确的密码,我确定密码是正确的.但一直连不上啊,提示如下:
yaya@ubuntu:~/.ssh$ ssh fangfei@211.69.198.211
Password: 
Password: 
Password: 
Permission denied (publickey,keyboard-interactive).
yaya@ubuntu:~/.ssh$ 


不知道是什么原因,之前可以登录的,然就突然断线了,(我似乎将know_hosts清空过一次,服务器和电脑都清空过),就没做什么改动了.就一直连不上,别人的电脑都可以连上,我的电脑连不上.是服务器拒绝我访问么?

------解决方案--------------------
直接删除known_hosts,让系统自建一个
rm /home/yaya/.ssh/known_hosts
------解决方案--------------------
很有可能是服务器的密钥改变了,然后服务器内部的认证authorized_keys变化了,可以删除里边你的公钥,再重新认证登录下试试