本文共 939 字,大约阅读时间需要 3 分钟。
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8909 -j ACCEPT
======================================================================
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8909-j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
重启防火墙,使配置生效:
/etc/init.d/iptables restart
service iptables restart
=======================================================================2、备份ssh端口配置文件
cp /etc/ssh/ssh_config /etc/ssh/ssh_configbak
cp /etc/ssh/sshd_config /etc/ssh/sshd_configbak
修改ssh端口为:8909
转载地址:https://blog.csdn.net/weixin_33765959/article/details/116839587 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!