首页 > 编程知识 正文

centos6关闭防火墙命令,怎么关闭centos虚拟机防火墙

时间:2023-05-03 15:10:37 阅读:174987 作者:407

使用Xcell或FinalShell等ssh工具连接到Centos7虚拟机时,即使帐户和密码正确,连接超时也很常见。 主要原因是虚拟机的防火墙问题。 关闭centos7防火墙的步骤如下所示。

命令:使用systemctlstatusfirewalld.service显示防火墙的状态

[root@localhost~]# systemctlstatusfirewalld.servicefirewall d.service-firewalldaemonloaded 3333启用版本号preset 3360 7 hago docs : man : firewall d (1) mainPID:9153(firewalld ) cgroup :/system.slice/firewall d.service (9490 ) s大意河马/firewalld----nofork----noPID3月0601336030336008 localhost.localdomainsystemd [1] 3360 startingfirewalld-dynamicfirewalldaemon . 3月0601336030336009 localhost.localdomainsystemd [1] 3360 startedfirewalld

命令:使用systemctl stop firewalld.service关闭正在运行的防火墙

关闭[ root @ localhost~~ ] # systemctlstopfirewalld.service [ root @ localhost~~ ] #后,单击命令systemctlstatusfirewalld .

[root@localhost~]# systemctlstatusfirewalld.servicefirewall d.service-firewalldaemonloaded 3333启用版本号preset 3360 2 sago docs : man : firewall d (1) process :9153 execstart=/usr/s大意河马/firewall d-- no fork-- no PID $ firewall success (主PID :9153 ) code=exited, status=0/success(3月06日01:08 localhost.localdomainsystemd [1] 3360 startingfirewalld-dynamicfirewalldaemon . 3月0601336030336009 localhost.localdomainsystemd [1] 3360 startedfirewalld-dynamicfirewalldaemon.3月0609336006336057 localhost.localdomainsystemd [1] 3360 stoppingfirewalld-dynamicfirewalldaemon . 3月06日09336006336058 localhost.localdomainsystemd [1] : stoped firewarewaremon

以前的方式只有这次关机有效,重新启动操作系统后,防火墙会自动打开,所以只要能自动关闭开机的防火墙就可以了

命令:输入systemctldisablefirewalld.service以禁止防火墙服务器

[ root @ localhost~] # systemctldisablefirewalld.serviceremovedsymlink/etc/systemd/system/multi-user.target .

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。