自動root登錄
1、設置root密碼
sudo passwd root
根據提示輸入密碼(此時輸入的密碼是以后登錄root賬戶時的密碼)
2、設置ubuntu.conf
打開 /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf
修改 [Seat:*]
user-session=ubuntu autologin-guest=false autologin-user=root autologin-user-timeout=0 greeter-session=lightdm-gtk-greeter
3、修改/etc/pam.d/下文件
修改/etc/pam.d/gdm-autologin ,gdm-fingerprint,gdm-password
注釋每個文件中的 #auth required pam_succeed_if.so user != root quiet_success
4、修改/root/.profile文件
if [ "$BASH" ]; then if [ -f ~/.bashrc ]; then . ~/.bashrc fi fi tty -s && mesg n || true mesg n || true mesg n 2> /dev/null || true
這個文件是隱藏的,可點右上角三道桿來顯示隱藏文件
5、修改/etc/gdm3/custom.conf
# Enabling automatic login AutomaticLoginEnable = true AutomaticLogin = root # Enabling timed login TimedLoginEnable = true TimedLogin = root TimedLoginDelay = 5
轉自:https://www.cnblogs.com/atoman/p/13537856.html