Python实现一键打开/关闭防火墙
利用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实现一键打开/关闭防火墙相关推荐
- CentOS7使用firewalld打开关闭防火墙与端口
CentOS7使用firewalld打开关闭防火墙与端口 1.firewalld的基本使用 启动: systemctl start firewalld 关闭: systemctl stop firew ...
- linux查看/打开/关闭防火墙
1.查看防火墙状态 systemctl status firewalld 防火墙开启状态: 2.暂时关闭防火墙 systemctl stop firewalld 3.永久关闭防火墙 systemctl ...
- CentOS7 使用 firewalld 打开关闭防火墙与端口
前些天发现了一个巨牛的人工智能学习网站,通俗易懂,风趣幽默,忍不住分享一下给大家.点击跳转到教程. 1.firewalld的基本使用 启动: systemctl start firewalld关闭: ...
- CentOS7使用firewalld打开关闭防火墙与端口(转载)
1.firewalld的基本使用 启动: systemctl start firewalld 查看状态: systemctl status firewalld 停止: systemctl disabl ...
- CentOS7使用firewalld打开关闭防火墙与端口-----------健康之家
1.firewalld的基本使用 启动: systemctl start firewalld 关闭: systemctl stop firewalld 查看状态: systemctl status f ...
- CentOS 使用firewalld打开关闭防火墙与端口
1.firewalld的基本使用 启动: systemctl start firewalld 关闭: systemctl stop firewalld 查看状态: systemctl status f ...
- centos7 linux关闭端口占用,CentOS7使用firewalld打开关闭防火墙、端口
entos 7版本以后默认使用firewalld后,网上关于iptables的设置方法已经不管用了,想着反正iptable也不会用,索性直接搬官方文档,学习firewalld了,好像比iptables ...
- CentOS7关闭防火墙
2019独角兽企业重金招聘Python工程师标准>>> CentOS7关闭防火墙 每一次系统更新都带来不少的变化,导致我们要再重新学习,很伤呀.╮(╯﹏╰)╭ CentOS7的防火墙 ...
- linux防火墙桌面关闭端口,Linux关闭防火墙,开放端口
Centos/redhat系统: 开启防火墙 #systemctl start firewalld.service 停止firewall #systemctl stop firewalld.servi ...
最新文章
- 虚拟机红帽linux登陆密码,[操作系统]vmware虚拟机安装了linux(redhat)系统忘记登录密码怎么办...
- 进程注入后门工具Cymothoa
- 树中两个结点的最低公共祖先
- Qt Remote Object(QtRO)动态Replica实现进程间通信
- linux与windows双系统保持时间同步
- python 读取地震道头数据_python地震数据可视化详解
- 盐城计算机考试时间安排,2019盐城中考具体时间安排 什么时候考试
- linux kvm装ghost镜像,kvm安装win7虚拟机
- python怎么激活_Python窗口激活
- 大数据架构师——音乐数据中心平台离线数仓综合项目(一)
- Spring基础学习
- python中------decode解码出现的0xca问题解决方法
- 初识iPhone基带通讯
- html那些标签可以实现页面布局,网页的布局一般用什么来实现
- Manjaro系统更新,wifi用不了,解决方法
- JAVASE学习笔记 Java中的常用类--StringBuffer类、StringBuilder类
- mysql8.0源代码解析_源码解读:MySQL 8.0 InnoDB无锁化设计的日志系统
- 右键解决方案,没有“重定解决方案目标”这一菜单项
- 去哪儿网查不到历史订单_12306网站上超过30天的历史订单去哪儿找纪录?
- iOS10 注册极光推送(干货)