今天linux服务连不上了,刚开始以为是软件的问题,然后换了其他的软件也是不能连上,然后记录一下自己的问题,防止以后再犯。
之前先在windows的cmd里面ping了一下虚拟机的ip地址,发现ping不通,看了看防火墙是关闭的,然后修改了一下虚拟机的ip地址。
之后ping了一下,发现可以连接,但xftp还是连接不上,报错是拒绝连接`
The remote system nefused the connection.
之后关闭虚拟机的防火墙设置
service iptables stop
也可以用chkconfig iptables off
报错:iptables:unrecognized service
发现ubuntu系统和centos系统不同,查看防火墙状态
sudo ufw status
发现防火墙是关闭状态(inactive)
查看端口开启状态
sudo ufw allow 22
关闭防火墙
sudo ufw disable
外来访问允许
sudo ufw default allow
还是不行,想起之前安装虚拟机的时候没有安装ssh协议文件
sudo apt-get install openssh-server openssh-client
安装完成后连接
连接成功。