VNC 命令行、终端修改宝塔面板防火墙规则端口IP
适用场景:
linux系统
宝塔面板无法登录,本机IP被拒,导致无法登录
使用服务商VNC等终端工具登录服务器:
执行查询防火墙规则:
firewall-cmd --list-all
返回示例 如下:
public (active)
target: default
icmp-block-inversion: no
interfaces: eth0
sources:
services: cockpit dhcpv6-client ssh
ports: 80/tcp 443/tcp 39000-40000/tcp
protocols:
forward: no
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
rule family="ipv4" source address="123.113.215.12" port port="8432" protocol="tcp" accept
rule family="ipv4" source address="123.113.215.12" port port="13276" protocol="tcp" accept
rule family="ipv4" source address="123.113.215.12" port port="51" protocol="tcp" accept
rule family="ipv4" source address="123.113.215.12" port port="22" protocol="tcp" accept
删除规则:
firewall-cmd --remove-rich-rule='rule family="ipv4" source address="123.113.215.12" port port="8432" protocol="tcp" accept'
新增规则:
firewall-cmd --add-rich-rule='rule family="ipv4" source address="123.113.215.99" port port="8432" protocol="tcp" accept'
注意 登录宝塔面板后可能出现宝塔面板显示还是旧地址,这是因为宝塔的缓存的设置。




