限制SSH的登录IP

为了保证服务器的安全,我们可以对SSH的登录IP进行限制。要实现这个功能,有两个方法:
1.IPTABLES大法
使用如下指令可以将1.2.3.4添加到可访问的IP列表内。如果要添加多个IP,只要多次执行第一句即可。第二句只需要执行一次。
# All connectsion from address 1.2.3.4 to SSH (port 22)
iptables -A INPUT -p tcp -m state --state NEW --source 1.2.3.4 --dport 22 -j ACCEPT

# Deny all other SSH connections
iptables -A INPUT -p tcp --dport 22 -j DROP

执行完了之后别忘了service iptables save保存修改
2.使用hosts.allow和hosts.deny
按照如下方式修改/etc/hosts.allow
# (更多…)

1分钟内保护你的Linux服务器—Server Shield v1.0.2

Server Shield是一个轻量级的linux服务器安全加固软件。它安装简单、稳定,能够直接有效的使你的服务器抵御黑客攻击。

特性

Slowloris Protection
Firewall Hardening
TCP Hardening
ICMP/Ping Flood Protection
DoS Protection
Spoof Protection
FTP/SSH Bruteforce Protection
Automatic Security Updates
Disables Bash History
DNS Amplification Protection

依赖

yum-security
iptables
net-tools
sed
gawk
git
gcc

安装

 

git clone https://github.com/Brian-Holt/server-shield
cd (更多…)

iptables设置远程桌面端口映射 禁止特定mac地址访问

远程桌面:

iptables -t nat -A PREROUTING -d 210.26.24.98 -p tcp --dport 3389 -j DNAT --to 192.168.200.199:3389

iptables -t nat -A POSTROUTING -d 192.168.200.199 -p tcp --dport 3389 -j SNAT --to 210.26.24.98

 

内网192.168.200.199

外网210.26.24.98

网页映射:

iptables -t nat -A PREROUTING -d 210.26.24.98 -p tcp --dport 80 -j DNAT --to 192.168.200.199:80

iptables -t nat -A POSTROUTING -d 192.168.200.199 (更多…)