使用ssh的最佳实践

使用ssh的最佳实践
1)only use ssh protocol 2
2)limit users SSh access
Allowusers root vivek jerry
白名单
denyUser saroj anjali foo
黑名单
3)configure Idle Log out timeout Interval 配置空闲超时长。
ClientAliveCountMax 300
ClientAliveInterval 0
4)Firwall SSH Port # 22
使用iptables设置ssh服务安全访问策略
5)change ssh port and Limit IP binding
port 300
Listaddress 192.168.1.5
ListenAddress 202.54.1.5
勿使用默认22端口
6)use Strong SSH passwords and passphrase
genpasswd(){
local 1=$1
[ "$1" == "" ]&& 1=20
tr -dc A-Za-z0-9_</dev/urandom | head -c ${1} | xargs
}
使用足够长足够复杂的密码,且定期更换。
7)use Public key Based AUthentication
使用公钥认证。
8)disable Empty password
9)thwart ssh crakers (Brute Force attack)
google:ssh best practice
10)rate-limit incoming port # 22 COnnections
限制ssh访问频度
11)use log analyzer
记录好日志,经常做日志分析。

posted @ 2015-12-09 17:09  自然-->开心点  阅读(201)  评论(0编辑  收藏  举报