首先设置一个普通的登录用户
useradd testuser
passwd testpasswd
然后修改配置文件sshd_config
#将PermitRootLogin 后面的值修改为no
PermitRootLogin no
#最大尝试登录次数
MaxAuthTries 5
最后重启ssh服务
systemctl restart sshd.service
#登录普通账户时,使用su或者sudo命令即可切换root账户
日常记录,言语随心。
useradd testuser
passwd testpasswd
#将PermitRootLogin 后面的值修改为no
PermitRootLogin no
#最大尝试登录次数
MaxAuthTries 5
systemctl restart sshd.service
#登录普通账户时,使用su或者sudo命令即可切换root账户