命令行下开启与关闭windows防火墙关端口(转)

简介: sc config sharedaccess start= auto //设置防火墙服务为自动 net start sharedaccess //开启防火墙服务   关闭端口 netsh firewall add portopening protocol = TCP port = 139 n...

sc config sharedaccess start= auto //设置防火墙服务为自动

net start sharedaccess //开启防火墙服务

 

关闭端口

netsh firewall add portopening protocol = TCP port = 139 name = "关闭139" mode = DISABLE

netsh firewall add portopening protocol = TCP port = 445 name = "关闭445" mode = DISABLE

netsh firewall add portopening protocol = UDP port = 137 name = "关闭137" mode = DISABLE

netsh firewall add portopening protocol = UDP port = 138 name = "关闭138" mode = DISABLE 

 

开启端口

netsh firewall add portopening protocol = TCP port = 139 name = "开启139" mode = ENABLE

netsh firewall add portopening protocol = TCP port = 445 name = "开启445" mode =  ENABLE

netsh firewall add portopening protocol = UDP port = 137 name = "开启137" mode =  ENABLE

netsh firewall add portopening protocol = UDP port = 138 name = "开启138" mode =  ENABLE

目录
相关文章
|
11月前
|
网络协议 安全 网络安全
详细阐述 TCP、UDP、ICMPv4 和 ICMPv6 协议-以及防火墙端口原理优雅草卓伊凡
详细阐述 TCP、UDP、ICMPv4 和 ICMPv6 协议-以及防火墙端口原理优雅草卓伊凡
702 2
|
10月前
|
网络协议 Linux 网络安全
CentOS防火墙管理:查询与配置开放端口的技巧
遵循以上步骤,CentOS系统管理员能够灵活地查询和管理系统端口的开放情况,并且能适用于大多数防火墙管理场合。务必在改变防火墙规则后认真审核和测试,以确保网络安全性与服务的正常运行。
1577 0
|
Linux Windows
【Linux】grub命令行引导进入windows系统
【8月更文挑战第20天】在Linux中通过GRUB命令行引导Windows的方法包括:1) 进入GRUB命令行模式,启动时按`c`键;2) 使用`ls`查找含Windows引导文件的分区,如`bootmgr`或`ntldr`;3) 设置根设备`root=(hd0,msdos3)`与链加载器`chainloader +1`;4) 输入`boot`命令启动Windows。请注意实际步骤可能因系统配置而异。
3153 3
|
Windows
Windows 11 鼠标右键可选择 cmd 命令行选项
Windows 11 鼠标右键可选择 cmd 命令行选项
419 0
|
缓存 数据安全/隐私保护 虚拟化
windows端口被占用,无法通过netstat找到进程,占用的端口又不能修改,该怎么办?
项目运行时服务器8080端口被占用,常规`netstat`命令找不到占用进程。解决方法包括:1) 强制关机重启释放端口;2) 使用`netstat -anobq`或Windows 10的`Get-NetTCPConnection` PowerShell命令查找BOUND状态的进程;3) 调整Windows动态端口范围,避免冲突。注意,强制关机可能影响数据安全。
6682 2
|
网络协议 安全 Docker
windows环境下的设置docker远程访问(开放2375端口)
windows环境下的设置docker远程访问(开放2375端口)
4679 0
|
弹性计算 人工智能 供应链
云服务器 ECS产品使用问题之端口已加入安全组,但是端口不通,同时服务器已关闭防火墙,是什么导致的
云服务器ECS(Elastic Compute Service)是各大云服务商阿里云提供的一种基础云计算服务,它允许用户租用云端计算资源来部署和运行各种应用程序。以下是一个关于如何使用ECS产品的综合指南。
|
网络协议 Java Linux
Linux常用操作命令、端口、防火墙、磁盘与内存
Linux常用操作命令、端口、防火墙、磁盘与内存
|
8月前
|
安全 数据安全/隐私保护 虚拟化
Windows Server 2022 中文版、英文版下载 (2025 年 10 月更新)
Windows Server 2022 中文版、英文版下载 (2025 年 10 月更新)
2036 2
Windows Server 2022 中文版、英文版下载 (2025 年 10 月更新)
|
8月前
|
安全 Unix 物联网
Windows 7 & Windows Server 2008 R2 简体中文版下载 (2025 年 10 月更新)
Windows 7 & Windows Server 2008 R2 简体中文版下载 (2025 年 10 月更新)
872 0
Windows 7 & Windows Server 2008 R2 简体中文版下载 (2025 年 10 月更新)