Linxu中使用防火墙命令(sudo命令执行)

sudo : 暂时切换到超级用户模式以执行超级用户权限,一般指的是root用户,提示输入密码时该密码为当前用户的密码,而不是超级账户的密码。不过有时间限制,Ubuntu默认为一次时长15分钟。

查看所有开启端口,查看防火墙,添加的端口也可以看到
firewall-cmd --list-all
重启防火墙服务
sudo systemctl restart firewalld.service
sudo systemctl enable firewalld
查看防火墙状态
sudo systemctl status firewalld
永久关闭防火墙
sudo systemctl disable firewalld
查看防火墙状态
sudo systemctl stop firewalld

扩展文章供参考:
https://www.linuxprobe.com/sudo-sudo-su.html
https://mp.weixin.qq.com/s?__biz=MzU3NTgyODQ1Nw==&mid=2247495776&idx=3&sn=f1ba02d6aa82fec1702986289e0b321b&chksm=fd1f88e6ca6801f0ccdc5aba1aa640334d6df1117902764d45dcbc10db04f7f2a25e316d4b29&mpshare=1&scene=1&srcid=0920jnJBic5gyBLmIp9m5uaf&sharer_sharetime=1600588895144&sharer_shareid=6f243aebe9fbc3604fa7bbcda4395fb6&key=1fb38d1ad08361bbfe4ce720d95f199d58a088b81cb381b2c60ac65b74e3740430f4e9f8b95c760aef773b87688d840d1ee789927b11f9f41fd2467520ee108c8a5c06922eab277fb36494903644b38f8317515d584083428b2856de79fa3849aa7c257744cc3b6f234601252f7091c414a1ca50729a0d21d5b1405ed55dd4dd&ascene=1&uin=MjE0MDM3ODYyNw%3D%3D&devicetype=Windows+10+x64&version=62090529&lang=zh_CN&exportkey=A8NgJtuZXJgSoQVIkf2Ttqg%3D&pass_ticket=3Bk00eJ1KRhIZGuP%2FF73BQAlNcSI6D8FItJqye4gTAg1gnckO%2Biue7uERTdxhXG9&wx_header=0

上一篇:linux 常用命令


下一篇:Linux配置开机自启