SSH安全策略

SSH安全策略:
ss

配置基本安全策略
调整sshd服务配置,并重载服务

[root@ ~]# vim /etc/ssh/sshd_config
.. ..
Protocol 2                                          //去掉SSH协议V1
PermitRootLogin no                                  //禁止root用户登录
PermitEmptyPasswords no                              //禁止密码为空的用户登录
UseDNS  no                                          //不解析客户机地址
LoginGraceTime  1m                                  //登录限时
MaxAuthTries  3                                      //每连接最多认证次数
.. ..
[root@ ~]# systemctl restart sshd

测试基本安全策略

尝试以root用户SSH登录,失败:

[root@~]# ssh [email protected]
[email protected]'s password:
Permission denied, please try again.

将服务器上用户kate(如无该账户则先创建)的密码设为空,尝试SSH登录,也会失败:

[root@~]# passwd -d kate                          //清空用户口令
清除用户的密码 kate。
passwd: 操作成功
[root@ ~]# ssh [email protected]
[email protected]'s password:
Permission denied, please try again.

针对SSH访问采用仅允许的策略,未明确列出的用户一概拒绝登录

发布了221 篇原创文章 · 获赞 177 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/weixin_44799645/article/details/105503523