1. 添加用户
adduser username
2. 设置密码
passwd username
然后设置密码
3.更改sshd_config
//找到sshd_config文件 whereis ssh //获取最高权限 chmod 777 /etc/ssh/sshd_config //编辑文件 找到PermitRootLogin yes一行 将yes修改为no,有可能前面加了#请把#删掉 PermitRootLogin no //保存退出: wq //修改权限为只读 chmod 444 /etc/ssh/sshd_config //刷新权限 systemctl restart sshd //此时root用户已经无法登录
还没有评论,来说两句吧...