M4Berry Ubuntu system realizes automatic login

Automatically log in to specify users This method can bring faster and easier startup.

Let’s explain the specific operation method under the ubuntu system.

Server version

Implement

nano /lib/systemd/system/[email protected]

Change ExecStart=-/sbin/agetty -o ‘-p – \u’ --keep-baud 115200,57600,38400,9600 %I $TERM to the following content

ExecStart=-/sbin/agetty --autologin root 115200,38400,9600 %I $TERM

You can modify root to other users

Desktop version

Execute first

ps -e | grep -E gdm|lightdm

Determine what format to use (ubuntu has two formats: lightdm or gdm2)

lightdm format

If lightdm.conf.d is not available in this directory, create it and fill in the content

sudo nano /etc/lightdm/lightdm.conf
[Seat:*]
autologin-user=root
autologin-user-timeout=0

gdm2 format

AutomaticLoginEnable=True
AutomaticLogin=root