防火墙安全策略之敲门暗号
增强计算机安全性的最后一种方案是最激进的:关闭所有打开的端口,这会让任何攻击都无法攻破您的计算机。
只向能够提供 “秘密敲门暗号” 的用户开放所需的端口,让用户能够输入密码并访问计算机。
敲门守护进程 knockd;它监视敲门序列,当发现有效的序列时执行相应的操作,iptables开放指定的端口给用户。
配置文件
[opencloseSSH]
sequence= 7000,8000,9000
tcpflags= syn
seq_timeout= 15
cmd_timeout= 30
start_command= /usr/sbin/iptables -s %IP% -I input_ext 1 -p tcp --dport 22960 -j ACCEPT
stop_command= /usr/sbin/iptables -s %IP% -D input_ext -p tcp --dport 22960 -j ACCEPT
使用方法
knock the.url.for.your.site 7000
knock the.url.for.your.site 8000
knock the.url.for.your.site 9000
ssh the.url.for.your.site -p 22960 -o ConnectTimeout=10
Password: