windows 通过cmd命令行管理防火墙
(1)恢复初始防火墙设置
netsh advfirewall reset
(2)关闭防火墙
netsh advfirewall set allprofiles state off
(3)启用桌面防火墙
netsh advfirewall set allprofiles state on
(4)设置默认输入和输出策略
netsh advfirewall set allprofiles firewallpolicy allowinbound,allowoutbound
以上是设置为允许,如果设置为拒绝使用blockinbound,blockoutbound
(5)关闭tcp协议的139端口
netsh advfirewall firewall add rule name=”deny tcp 139″ dir=in protocol=tcp localport=139 action=block
(6)关闭udp协议的139端口
netsh advfirewall firewall add rule name=”deny udp 139″ dir=in protocol=udp localport=139 action=block
(7)关闭tcp协议的445端口
netsh advfirewall firewall add rule name=”deny tcp 445″ dir=in protocol=tcp localport=445 action=block
(8)关闭udp协议的445端口
netsh advfirewall firewall add rule name=”deny udp 445″ dir=in protocol=udp localport=445 action=block
(9)使用相同的方法,依次关闭TCP协议的21、22、23、137、138、3389、5800、5900端口。
netsh advfirewall firewall add rule name= “deny tcp 21″ dir=in protocol=tcp localport=21 action=block
netsh advfirewall firewall add rule name= “deny tcp 22″ dir=in protocol=tcp localport=22 action=block
netsh advfirewall firewall add rule name= “deny tcp 23″ dir=in protocol=tcp localport=23 action=block
netsh advfirewall firewall add rule name= “deny tcp 3389″ dir=in protocol=tcp localport=3389 action=block 学习电脑
netsh advfirewall firewall add rule name= “deny tcp 5800″ dir=in protocol=tcp localport=5800 action=block
netsh advfirewall firewall add rule name= “deny tcp 5900″ dir=in protocol=tcp localport=5900 action=block
netsh advfirewall firewall add rule name= “deny tcp 137″ dir=in protocol=tcp localport=137 action=block
netsh advfirewall firewall add rule name= “deny tcp 138″ dir=in protocol=tcp localport=138 action=block 以上内容搬运自百度知道https://zhidao.baidu.com/question/2075121309871751268.html,稍作整理
windows 通过cmd命令行管理防火墙的更多相关文章
- 玩转Windows服务系列——命令行管理Windows服务
说到Windows服务的管理就不得不说通过命令行的方式管理Windows服务,因为无论是系统管理员,还是通过编程的方式调用cmd命令,命令行都是非常方便以及强大的工具. 接下来就看一下如何通过cmd命 ...
- 玩转Windows服务系列——命令行管理Windows服务
原文:玩转Windows服务系列——命令行管理Windows服务 说到Windows服务的管理就不得不说通过命令行的方式管理Windows服务,因为无论是系统管理员,还是通过编程的方式调用cmd命令, ...
- [转]玩转Windows服务系列——命令行管理Windows服务
本文转自:http://www.cnblogs.com/hbccdf/p/managewindowsservicewithcmd.html 说到Windows服务的管理就不得不说通过命令行的方式管理W ...
- windows下cmd命令行显示UTF8字符设置(CHCP命令)
本文由 www.169it.com 收集整理 在中文Windows系统中,如果一个文本文件是UTF-8编码的,那么在CMD.exe命令行窗口(所谓的DOS窗口)中不能正确显示文件中的内容.在默认情况下 ...
- WINDOWS XP中用命令行管理用户 net user命令
net user <username> [password or *] [/add] [options] [/domain] net user <username] /delete ...
- Windows 常用Cmd命令行 (持续更新...)
查看IP ipconfig 查看WIFI密码 netsh wlan show profiles wifi_name key = clear 系统探针 systeminfo CMD重定向 输出符号> ...
- windows下cmd命令行计算文件hash值
命令:certutil -hashfile certutil -hashfile D:\.exe MD5 certutil -hashfile D:\.exe SHA1 certutil -hashf ...
- Windows 常用 CMD 命令行介绍
看下面的链接: http://www.jianshu.com/p/76ff5d16f113
- windows下cmd命令行上传代码到github的指定库
https://blog.csdn.net/a419419/article/details/80063010 git错误:unable to auto-detect email address 解决办 ...
随机推荐
- JAVA 获取类名,函数名
获取以下获取方法所在函数的相关信息 1.获取当前函数名:Thread.currentThread().getStackTrace()[1].getMethodName(); 2.获取当前类名:Thre ...
- [CF666E]Forensic Examination:后缀自动机+线段树合并
分析 用到了两个小套路: 使用线段树合并维护广义后缀自动机的\(right\)集合. 查询\(S[L,R]\)在\(T\)中的出现次数:给\(T\)建SAM,在上面跑\(S\),跑到\(R\)的时候先 ...
- plt.plot() 无法使用参数ax
问题参考 TypeError: inner() got multiple values for keyword argument 'ax' fig, ax=plt.subplots(2,1) plt. ...
- 《信息安全系统设计基础》--Myod
Myod 回顾Makefile 任务详情 复习c文件处理内容 编写myod.c 用myod XXX实现Linux下od -tx -tc XXX的功能 main与其他分开,制作静态库和动态库 编写Mak ...
- TensorFlow常用操作
初始化数据: # -*- coding: utf-8 -*- import tensorflow as tf a = tf.zeros([3, 4], tf.int32) # [[0 0 0 0] # ...
- android 播放音乐媒体文件(一)
Audio formats and codecs Format / Codec Encoder Decoder Details Supported File Type(s) / Container F ...
- 4.数据挖掘的数据仓库与OLAP技术
1.什么是数据仓库 面向主题的.集成的.时变的.非易失的 2.数据仓库和异种DBMS 3.OLTP vs OLAP 4.为什么建立分离的数据仓库? 5.多维数据模型(数据仓库的概念建模)三类度量 4. ...
- Java -- 通过 URLConnection 进行http请求中文乱码
对writer和reader指定字符集 out = new PrintWriter(new OutputStreamWriter(conn.getOutputStream(), "utf-8 ...
- Python_List对象内置方法详解
目录 目录 前言 软件环境 列表List 修改列表的元素 插入列表元素 extend 将序列中的元素迭代的附加到list中 insert 在指定的索引号中插入一个元素 删除列表元素 del 删除Lis ...
- VSCode添加 console.log 快捷键
file - preferences - keyboard shortcuts - keybindings.json: 添加: { "key": "ctrl+ ...