How to automatic login Rocky linux

I just installed Rocky Linux 8.5 and I’d like setup root account automatic login to terminal when server boot, I tried change /etc/gdm/custom.conf:
[daemon]
AutomaticLoginEnable=True
AutomaticLogin=root

But it didn’t work.

Any ideas?

Thanks a million.

I have resolved the issus.

# cd /etc/systemd/system/getty.target.wants
# vi getty@tty1.service

Change:

"ExecStart=-/sbin/agetty -o '-p -- \\u' --noclear %I $TERM" to "ExecStart=-/sbin/agetty --noclear --autologin root %I $TERM"

And reboot server.

1 Like