
本篇文章中重点为大家讲解一下Linux中配置Ubuntu 配置单root用户登录具体方法,有需要的小伙伴可以参考一下。
shell命令
sudo vim usr/share/lightdm.conf.d/50-ubuntu.conf //编辑器不限
[SeatDefaults]
user-session=ubuntu
greeter-show-manual-login=true #手工输入登录系统的账号密码
allow-guest=false #禁止guest登录
修改root密码
sudo passwd root
修改/root/.profile
sudo vim /root/.profile //root首次登录会报错解决方法
# ~/.profile: executed by Bourne-compatible login shells.if [ "$BASH" ]; thenif [ -f ~/.bashrc ]; then
. ~/.bashrc
fifi
#mesg n 注释掉mesg n 增加一行tty -s && mesg n
tty -s && mesg n
修改ssh配置文件允许root登录
sudo vim /etc/ssh/sshd_config
#permitRootLogin without-password 注释掉这行,新增下面一行
permitRootLogin yes
重启ssh服务即可
文章来源网络,作者:运维,如若转载,请注明出处:https://shuyeidc.com/wp/204535.html<