关于linux 端口的命令
2018-07-11 本文已影响0人
刘融Gina
# 检查linux开放的端口
/sbin/iptables -L -n
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:22 ctstate NEW
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:80 ctstate NEW
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:8088 ctstate NEW
ACCEPT udp -- 0.0.0.0/0 0.0.0.0/0 udp dpt:8787 ctstate NEW
...
# 显示6379 这个端口没有开
# 开放端口命令
/sbin/iptables -I INPUT -p tcp --dport 6379 -j ACCEPT
# 保存
/etc/rc.d/init.d/iptables save