linux下如何禁用root账户直接登陆
linux-dash
A beautiful web dashboard for Linux
项目地址:https://gitcode.com/gh_mirrors/li/linux-dash

·
昨天下了日志一看,太多人想进来我机器作客了,于是得把root登陆干掉
1.新建一个账户吧 用这个账户来登陆
adduser testuser
2.设置密码
passwd testuser
然后按提示输入密码即可
3.修改SSHD配置,禁止root直接登录
vi /etc/ssh/sshd_config
请注意这个文件需要root权限才能改,找到“PermitRootLogin yes”把注释去掉 保存,然后重启sshd服务
service sshd restart
4.下次登陆的时候先用testuser登陆,然后再su root切换到root下即可!




A beautiful web dashboard for Linux
最近提交(Master分支:5 个月前 )
186a802e
added ecosystem file for PM2 4 年前
5def40a3
Add host customization support for the NodeJS version 4 年前
更多推荐
所有评论(0)