首页 > 系统相关 >Ubuntu 防火墙 ufw

Ubuntu 防火墙 ufw

时间:2023-09-23 12:13:42浏览次数:39  
标签:22 sudo 端口 防火墙 allow Ubuntu ufw

Ubuntu 防火墙 ufw

sudo apt-get install ufw

启用 ufw

sudo ufw enable

关闭 ufw

sudo ufw disable 

查看 ufw 状态

sudo ufw status 

开启/禁用相应端口或服务举例

sudo ufw allow 22 # 允许外部访问22端口
sudo ufw delete allow 22 # 禁止外部访问80 端口
sudo ufw allow from 192.168.1.1 # 允许此IP访问所有的本机端口

标签:22,sudo,端口,防火墙,allow,Ubuntu,ufw
From: https://www.cnblogs.com/liuzonglin/p/17724138.html

相关文章

  • Ubuntu 22.04 安装 Docker
    安装基础工具sudoapt-getinstallca-certificatescurlgnupglsb-release安装官方的GPGkeysudomkdir-p/etc/apt/keyringscurl-fsSLhttps://download.docker.com/linux/ubuntu/gpg|sudogpg--dearmor-o/etc/apt/keyrings/docker.gpg将Docker的库添加到apt资源......
  • Ubuntu(Ubuntu 22.04 操作系统) 安装 Docker
    Ubuntu(Ubuntu22.04操作系统)安装Docker首先安装一些工具:sudoapt-getinstallca-certificatescurlgnupglsb-release不过在Ubuntu22.04已经默认安装好了。接着安装官方的GPGkey:sudomkdir-p/etc/apt/keyringscurl-fsSLhttps://download.docker.com/linux/ubun......
  • CentOS7 防火墙
    CentOS7防火墙sudosystemctlstatusfirewalld#查看防火墙的状态sudosystemctlstartfirewalld#临时打开防火墙,立即生效。sudosystemctlstopfirewalld#临时关闭防火墙,立即生效。sudosystemctlenablefirewalld#永久开启防火墙,重启后生效。sudosy......
  • CentOS7 关闭防火墙或开放端口
    CentOS7关闭防火墙或开放端口关闭防火墙systemctlstartfirewalld.servicesystemctlstatusfirewalld.servicesystemctlstopfirewalld.service#设置开机启用防火墙systemctlenablefirewalld.service#设置开机禁用防火墙systemctldisablefirewalld.service开......
  • ubuntu上使用微信界面太小
    一开始:小小的也很可爱呢后来使用命令调整envWINEPREFIX="$HOME/.ukylin-wine/wechat"/usr/bin/ukylin-winewinecfg 进入wine设置界面将分辨率调高,设置虚拟桌面,就可以勉勉强强用了。 还是很难用!!!哭......
  • ubuntu18更新失败提示401 Unauthorized
    当ubuntu18执行sudoaptupdatesudoaptupgrade在upgrade的过程中会出现以下错误122esm-infrasecurityupdatesNeedtoget309MB/309MBofarchives.Afterthisoperation,122MBofadditionaldiskspacewillbeused.Err:1https://esm.ubuntu.com/infra/ubuntu......
  • ubuntu20安装opencv3.4.9 多版本
    1下载源码下载源码https://github.com/opencv/opencv/releases/tag/3.4.9  下载扩展源码 https://github.com/opencv/opencv_contrib/releases/tag/3.4.9 2安装依赖sudoapt-getupdatesudoapt-getinstall-ybuild-essentialcmakegitlibgtk2.0-devpkg-......
  • Ubuntu20.04 ping Temporary failure in name resolution问题
    解决步骤vi/etc/systemd/resolved.conf将DNS的注释取消掉并改成8.8.8.8即可参考:https://blog.csdn.net/weixin_43354181/article/details/105352203......
  • Ubuntu通过certbot手动配置Let's Encrypt SSL泛型域名证书
    1.安装Snap使用命令安装snap,以及core组件sudoaptinstallsnapdsudosnapinstallcoresudosnaprefreshcore2.移除旧有的certbotsudoapt-getremovecertbotsudodnfremovecertbotsudoyumremovecertbot3.安装certbotsudosnapinstall--classiccertbot......
  • ubuntu安装Dirsearch
    准备pip换源cdmkdirpipcdpipvimpip.ini将以下内容编辑进文件后保存退出#coding:GBK[global]index-url=https://pypi.tuna.tsinghua.edu.cn/simple[install]trusted-host=https://pypi.tuna.tsinghua.edu.cn#清华大学:https://pypi.tuna.tsinghua.edu.cn/simp......