第一步:给root用户设置个密码
没试过空密码行不行,不折腾.
$ sudo passwd root
第二步:在配置文件里设置自启动
1、编辑/etc/lightdm/lightdm.conf:
$ sudo gedit /etc/lightdm/lightdm.conf
添加如下:
[Seat:*]
autologin-guest=false
autologin-user=root
autologin-user-timeout=0
greeter-session=lightdm-gtk-greeter
- 1
- 2
- 3
- 4
- 5
2、编辑/root/.profile文件:
$ sudo gedit /root/.profile
最后一行改成tty -s && mesg n || true,重启后自动进入root用户:
#~/.profile: executed by Bourne-compatible login shells.
if [ "$BASH" ]; then
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
fi
tty -s && mesg n || true