利用python一键打开或关闭防火墙

#!/usr/bin/python
# -*- coding: GBK -*-
"""
@author: Roc-xb
"""
import os# 启用防火墙
def open_firewall():os.system("netsh advfirewall set currentprofile state on")os.system("netsh advfirewall set domainprofile state on")os.system("netsh advfirewall set privateprofile state on")print("防火墙已开启")# 关闭防火墙
def close_firewall():os.system("netsh advfirewall set currentprofile state off")os.system("netsh advfirewall set domainprofile state off")os.system("netsh advfirewall set privateprofile state off")print("防火墙已关闭")

Python实现一键打开/关闭防火墙相关推荐

  1. CentOS7使用firewalld打开关闭防火墙与端口

    CentOS7使用firewalld打开关闭防火墙与端口 1.firewalld的基本使用 启动: systemctl start firewalld 关闭: systemctl stop firew ...

  2. linux查看/打开/关闭防火墙

    1.查看防火墙状态 systemctl status firewalld 防火墙开启状态: 2.暂时关闭防火墙 systemctl stop firewalld 3.永久关闭防火墙 systemctl ...

  3. CentOS7 使用 firewalld 打开关闭防火墙与端口

    前些天发现了一个巨牛的人工智能学习网站,通俗易懂,风趣幽默,忍不住分享一下给大家.点击跳转到教程. 1.firewalld的基本使用 启动: systemctl start firewalld关闭: ...

  4. CentOS7使用firewalld打开关闭防火墙与端口(转载)

    1.firewalld的基本使用 启动: systemctl start firewalld 查看状态: systemctl status firewalld 停止: systemctl disabl ...

  5. CentOS7使用firewalld打开关闭防火墙与端口-----------健康之家

    1.firewalld的基本使用 启动: systemctl start firewalld 关闭: systemctl stop firewalld 查看状态: systemctl status f ...

  6. CentOS 使用firewalld打开关闭防火墙与端口

    1.firewalld的基本使用 启动: systemctl start firewalld 关闭: systemctl stop firewalld 查看状态: systemctl status f ...

  7. centos7 linux关闭端口占用,CentOS7使用firewalld打开关闭防火墙、端口

    entos 7版本以后默认使用firewalld后,网上关于iptables的设置方法已经不管用了,想着反正iptable也不会用,索性直接搬官方文档,学习firewalld了,好像比iptables ...

  8. CentOS7关闭防火墙

    2019独角兽企业重金招聘Python工程师标准>>> CentOS7关闭防火墙 每一次系统更新都带来不少的变化,导致我们要再重新学习,很伤呀.╮(╯﹏╰)╭ CentOS7的防火墙 ...

  9. linux防火墙桌面关闭端口,Linux关闭防火墙,开放端口

    Centos/redhat系统: 开启防火墙 #systemctl start firewalld.service 停止firewall #systemctl stop firewalld.servi ...

最新文章

  1. 虚拟机红帽linux登陆密码,[操作系统]vmware虚拟机安装了linux(redhat)系统忘记登录密码怎么办...
  2. 进程注入后门工具Cymothoa
  3. 树中两个结点的最低公共祖先
  4. Qt Remote Object(QtRO)动态Replica实现进程间通信
  5. linux与windows双系统保持时间同步
  6. python 读取地震道头数据_python地震数据可视化详解
  7. 盐城计算机考试时间安排,2019盐城中考具体时间安排 什么时候考试
  8. linux kvm装ghost镜像,kvm安装win7虚拟机
  9. python怎么激活_Python窗口激活
  10. 大数据架构师——音乐数据中心平台离线数仓综合项目(一)
  11. Spring基础学习
  12. python中------decode解码出现的0xca问题解决方法
  13. 初识iPhone基带通讯
  14. html那些标签可以实现页面布局,网页的布局一般用什么来实现
  15. Manjaro系统更新,wifi用不了,解决方法
  16. JAVASE学习笔记 Java中的常用类--StringBuffer类、StringBuilder类
  17. mysql8.0源代码解析_源码解读:MySQL 8.0 InnoDB无锁化设计的日志系统
  18. 右键解决方案,没有“重定解决方案目标”这一菜单项
  19. 去哪儿网查不到历史订单_12306网站上超过30天的历史订单去哪儿找纪录?
  20. iOS10 注册极光推送(干货)

热门文章

  1. redis 分布式锁流程图
  2. Matplotlib安装感想
  3. iOS相同字符串保存地址唯一
  4. iOS Crash文件的解析(一)
  5. 初探Openstack Neutron DVR
  6. hdu 2883 kebab 网络流
  7. Android WebView JavaScript交互
  8. BZOJ 1013 球形空间产生器
  9. 关于在CVS下无法获取更新的解决方法!!!
  10. Oracle异常汇总