1、增加端口
sudo firewall-cmd --add-port=8088/tcp --permanent (8088是端口号)
sudo firewall-cmd --reload
firewall-cmd --list-all
2、移除端口:
firewall-cmd --permanent --remove-port=2181/tcp
3、#允许ip172.17.0.3访问6379端口
添加富规则
firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="172.17.0.3" port protocol="tcp" port="6379" accept"
firewall-cmd --reload
移除富规则
firewall-cmd --permanent --remove-rich-rule="rule family="ipv4" source address="172.17.0.6" port protocol="tcp" port="3306" accept"
firewall-cmd --reload
#查看已设置规则
firewall-cmd --zone=public --list-rich-rules
#将目录权限赋给某个用户
chown -R dell:dell /apps/files/2023
文章讲述了如何使用firewall-cmd命令在Linux系统中管理防火墙规则,包括添加和移除特定端口,以及设置允许特定IP访问特定端口的富规则。同时提到了使用chown命令为目录分配用户权限。
560

被折叠的 条评论
为什么被折叠?



