0

I'm not talking about auto login to the GUI.

I need to auto login a user on tty4 or tty5

Does someone have a procedure to doing that?

Nmath
  • 12,664
Patrice
  • 21

1 Answers1

1

These commands will configure a server to autologin the root user on tty4.

mkdir -p /etc/systemd/system/getty@tty4.service.d
cat <<EOF > /etc/systemd/system/getty@tty4.service.d/autologin.conf
[Service]
ExecStart=
ExecStart=-/sbin/agetty --noclear -n --autologin root %I $TERM
EOF

Hopefully it is obvious how to change the user or tty.

notes

I am stealing the configuration from the live-server image which will autologin the ubuntu-server user on any tty.

I tested this on Ubuntu 22.04.