|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
先修改SSH端口,默认22,很容易被扫到,需要修改SSH默认登陆端口。建议大于10000小于65535:
将“#port 22”改为:
-
- port xxxxx //”x”为你的端口号
- /etc/init.d/sshd restart //重启SSH
复制代码 现在端口已改,可以放心使用。不过再增加个iptables规则就更安全了,设置一些常用端口,出于某些原因,有的程序独立占用了一个独立ip和端口,所以需要以下设置:
- iptables -F
- iptables -P INPUT DROP
- /sbin/iptables -I INPUT -p tcp --dport 22 -j ACCEPT
- /sbin/iptables -I INPUT -p tcp --dport 1xxxx -j ACCEPT
- iptables -A INPUT -p tcp –s [your ip] --dport 2xxxx -j ACCEPT
- iptables -A INPUT -p udp -s [your ip] --dport 2xxxx -j ACCEPT
- iptables -A INPUT -p tcp -s [your ip2] --dport 2xxxx -j ACCEPT
- iptables -A INPUT -p udp -s [your ip2] --dport 2xxxx -j ACCEPT
- /etc/init.d/iptables save
- /etc/init.d/iptables restart
复制代码 以上基本操作完成,需要的不妨试试吧
|
|