出处:https://jingyan.baidu.com/article/219f4bf7ba682dde442d38b9.html
方法/步骤
-
最近使用xshell连接我VMware workstation里的虚拟机时,发现无法连接,但是可以ping通
-
进入虚拟机,打开终端,执行ps -e|grep ssh查看服务是否启动,发现服务没启动
![Ubuntu开启ssh服务](https://i-blog.csdnimg.cn/blog_migrate/8d1e5ab5fae234f0c5e601714f81936e.png)
-
使用service ssh start尝试开启ssh服务,发现没有该服务,因此需要安装openssh-server,如图,执行
apt-get install openssh-server
![Ubuntu开启ssh服务](https://i-blog.csdnimg.cn/blog_migrate/af6850e0572b98016acc9d990c0bfe8a.png)
-
安装成功之后,再执行ps -e|grep ssh,如图,服务已经开启了
![Ubuntu开启ssh服务](https://i-blog.csdnimg.cn/blog_migrate/0d7ec0d997744f8243ddb6b5b0ecb062.png)
-
这时再通过xshell进行远程连接,如图,连接成功
![Ubuntu开启ssh服务](https://i-blog.csdnimg.cn/blog_migrate/aa2d19430f8fea566d3292f7a9cf9bc3.png)