计算化学公社
标题:
Ubuntu 18 / 19 中 root 用户自动登陆的设置
[打印本页]
作者Author:
王二葛
时间:
2019-5-4 17:59
标题:
Ubuntu 18 / 19 中 root 用户自动登陆的设置
本帖最后由 王二葛 于 2019-5-4 22:29 编辑
因最近在 Ubuntu 中重建别人的计算环境,所以习惯上仿照 CentOS 中设置默认 root 自动登陆。Ubuntu 新版 18 甚至是 19 中,配置文件等都有更新,网络上大部分设置方法都已失效。经查找和实践,最终找到了能够设置 root 用户自动登陆的方法,已在 Ubuntu 19 中成功配置。
使用前请先对虚拟机进行快照。
1. 给 root 用户设置密码
sudo passwd root
复制代码
2. 修改文件
/usr/share/lightdm/lightdm.conf.d/50-unity-greeter.conf
文件,增加
greeter-show-manual-login=true
all-guest=false
autologin-user=root
复制代码
3. 编辑两个 gdm 文件,分别在
/etc/pam.d/gdm-autologin
和
/etc/pam.d/gdm-password
,均注释掉下面这一行(用井号 # 注释)
auth required pam_succeed_if.so user != root quiet_success
复制代码
4. 编辑文件
/etc/gdm3/custom.conf
,将下面两个选项分别改为 true 和 root,没有这两行就在对应的 [daemon] 下加上
[daemon]
AutomaticLoginEnable=true
AutomaticLogin=root
复制代码
5. 编辑登陆配置文件
/root/.profile
,最后一行
mesg n || true
替换为
tty -s&&mesg n || true
复制代码
6. 重启查看效果。此时终端显示不正常(全是白色字),且 apt 无法自动补全,执行
cp /etc/skel/.bashrc ~/
复制代码
即可正常。
参考资料:
1. ubuntu-18.04 root登录图形界面
https://blog.csdn.net/xiongchun11/article/details/80606106
2. 启用自动登录Ubuntu 18.04 Linux系统
https://ywnz.com/linuxjc/1624.html
3. 无法自动补全
https://askubuntu.com/questions/86375/apt-get-autocomplete-package-name-is-broken
欢迎光临 计算化学公社 (http://ccc.keinsci.com/)
Powered by Discuz! X3.3