我安装ubuntu14.04后,安装SSH,按照网上的教程操作。
sudo apt-get install openssh-server
客户端登录界面如下
$ ssh wtest@192.168.10.213
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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 ECDSA key sent by the remote host is
SHA256:Aevr9agOna/A5BfKPl43WlhFohBP/jF023je2RzR9JE.
Please contact your system administrator.
Add correct host key in /Users/wtest/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /Users/wtest/.ssh/known_hosts:1
ECDSA host key for 192.168.10.213 has changed and you have requested strict checking.
Host key verification failed.
$
我都蒙了,之前ubuntu18.04版本大概也是这么安装的就没有问题,这个版本反而这样,这就是它稳定的绝佳因素吗,啥也不容易装上去,所以稳定,我懂了。
在bing上搜索这个问题,找到到一个答案进行测试。
http://www.cnblogs.com/dongzhiquan/archive/2012/10/09/2717439.html
1.在客户端执行下述指令即可 #mv /root/.ssh/known_hosts /tmp
2.当然也可以直接编辑known_hosts文件,把里面与所要连接IP(192.168.10.20)相关的内容删掉即可.
看了一下我的电脑还真有这个文件。
/Users/wtest/.ssh/known_hosts
移动文件#mv /root/.ssh/known_hosts 这个文件,移动到/tmp里面。/root/换成自己的路径。自己的路径怎么看?
pwd
这一步我执行完了,或者来执行下一步。
sudo nano /Users/wtest/.ssh/known_hosts
那我就是把这一行都删除掉然后保存。
远程登录测试。
ssh wtest@192.168.10.213
The authenticity of host '192.168.10.213 (192.168.10.213)' can't be established.
ECDSA key fingerprint is SHA256:Aevr9agOna/A5BfKPl43WlhFohBP/jF023je2RzR9JE.
Are you sure you want to continue connecting (yes/no)? y
Please type 'yes' or 'no': yes
Warning: Permanently added '192.168.10.213' (ECDSA) to the list of known hosts.
wtest@192.168.10.213's password:
Welcome to Ubuntu 14.04.5 LTS (GNU/Linux 4.4.0-31-generic x86_64)
- Documentation: https://help.ubuntu.com/
388 packages can be updated.
308 updates are security updates.
New release '16.04.4 LTS' available.
Run 'do-release-upgrade' to upgrade to it.
Last login: Fri May 25 19:30:57 2018 from localhost
wtest@wtest-x61:~$
成功使用SSH远程登录了。