1问题描述报错

Connection closed by foreign host.

Disconnected from remote host(yaoGS) at 155513.

linux篇-xshell连接突然报Connection closed by foreign host._sed

2登入虚拟机

在linux系统操作中,经常需要连接其他的主机,连接其他主机的服务是openssh-server,它的功能是让远程主机可以通过网络访问sshd服务,开始一个安全shell

启动sshd服务

service sshd start

3 sshd-t测试没有问题

4尝试连接

 linux篇-xshell连接突然报Connection closed by foreign host._sed_02

5还是没有解决,这个时候可能是ip冲突了

可以尝试改变网卡的ip

linux篇-xshell连接突然报Connection closed by foreign host._网络访问_03

6改变

linux篇-xshell连接突然报Connection closed by foreign host._sed_04

7重启网卡service network restart

linux篇-xshell连接突然报Connection closed by foreign host._重启_05