Simon的博客

专注于互联网后台架构开发

Mac系统终端通过ssh连接CentOS

1、用命令 "ssh -l zjy 10.211.55.4" 连接CentOS

zhaojunyandeMacBook-Pro:~ zhaojunyan$ ssh -l zjy 10.211.55.4

ssh: connect to host 10.211.55.4 port 22: Connection refused

zhaojunyandeMacBook-Pro:~ zhaojunyan$ 


说明CentOS的ssh服务没有打开或者ssh没有安装


2、用命令“ps -e|grep ssh”查看


说明安装了,没有安装的话安装一下,然后打开ssh服务



3、在Mac终端连接即可

zhaojunyandeMacBook-Pro:~ zhaojunyan$ ssh -l zjy 10.211.55.4

ssh: connect to host 10.211.55.4 port 22: Connection refused

zhaojunyandeMacBook-Pro:~ zhaojunyan$ ssh -l zjy 10.211.55.4

zjy@10.211.55.4's password: 

Last login: Sat Jul  1 14:23:15 2017 from 10.211.55.2

[zjy@livedvd ~]$ ls

Desktop    Downloads Music     Public    Videos

Documents  epoll.c    Pictures Templates

[zjy@livedvd ~]$ 


4、如果后面host key变了,需要删除known_hosts再连接

zhaojunyandeMacBook-Pro:~ zhaojunyan$ ssh -l zjy 10.211.55.4

ssh: connect to host 10.211.55.4 port 22: Connection refused

zhaojunyandeMacBook-Pro:~ zhaojunyan$ ssh -l zjy 10.211.55.4

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

@    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

SHA256:HU2Xk0sE+qxWBnGDGlkCzWFmdEliRwZOyKCzBIriXyc.

Please contact your system administrator.

Add correct host key in /Users/zhaojunyan/.ssh/known_hosts to get rid of this message.

Offending RSA key in /Users/zhaojunyan/.ssh/known_hosts:5

RSA host key for 10.211.55.4 has changed and you have requested strict checking.

Host key verification failed.

zhaojunyandeMacBook-Pro:~ zhaojunyan$ rm -rf ~/.ssh/known_hosts 

zhaojunyandeMacBook-Pro:~ zhaojunyan$ ssh -l zjy 10.211.55.4

The authenticity of host '10.211.55.4 (10.211.55.4)' can't be established.

RSA key fingerprint is SHA256:HU2Xk0sE+qxWBnGDGlkCzWFmdEliRwZOyKCzBIriXyc.

Are you sure you want to continue connecting (yes/no)? yes

Warning: Permanently added '10.211.55.4' (RSA) to the list of known hosts.

zjy@10.211.55.4's password: 

[zjy@livedvd ~]$ ls

Desktop    Downloads  epoll.c  Pictures  Templates

Documents  epoll      Music    Public    Videos

[zjy@livedvd ~]$ 



阅读更多
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Nick_666/article/details/74995589
文章标签: centos ssh
个人分类: Linux(CentOS/Ubuntu)
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

不良信息举报

Mac系统终端通过ssh连接CentOS

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭