ssh免密码登录
最近在服务器与服务器之间传文件,老是输入密码让我很烦躁,决定采用ssh key的方式来进行无密码互传,好了,看教程吧.
系统:centos 5.4
客户机A:192.168.1.253
远端主机B:192.168.1.254
原理:密钥相当于一把钥匙,而公钥就相当于一把门锁,我们当然是拿着钥匙去开锁,同样的道理,我们密钥放在本地服务器,也就是客户机A,把公钥放在远程服务器,也就是远端主机B,那么我们就可以从客户机A ssh免密码登陆远端主机B.
1.如果用户主目录下没有.ssh文件夹,可以执行以下命令
ssh连接的时候出现Host key verification failed.
今天在服务器上执行远程操作命令出现以下的问题:
[root@www ~]# ssh 205.209.161.**
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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 the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
6c:74:2a:d5:ae:2b:76:51:*:*.
Please contact your system administrator.
Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending key in /root/.ssh/known_hosts:20
RSA host key for 205.209.161.** has changed and you have requested strict checking.
Host key verification failed....