ssh服务安全加固
LiuSw Lv6

ssh服务安全加固

  • 1.修改端口号

Port 22 -> Port 222

  • 2.修改连接时间

LoginGraceTime 2m -> 20s

  • 3.禁止root直接登录

PermintRootLogin yes -> no

  • 4.密码验证(可选)

PasswordAuthentication yes

  • 5.空密码登录(默认为no不允许)

PerminEmptyPasswords no

  • 6.增加登录用户告警信息

/etc/motd文件内

  • 7.增加密码强度

  • 8.只用密钥登录,禁止密码登录

ssh-copy-id -i IP地址

  • 9.安装fail2ban服务
 评论