Table of Contents

VIM1S Auto Login

Introduction

This page mainly introduces automatic login under Ubuntu.

Desktop OS

Check SettingsUsersAutomatic Login.

Server OS (Headless)

For tty1-tty6:

sudo cp /lib/systemd/system/getty@.service /lib/systemd/system/getty@.service.backup
sudo sed -i "s/ExecStart=.*/ExecStart=-\/sbin\/agetty --noclear --autologin khadas \%I \$TERM/g" /lib/systemd/system/getty@.service

For ttyS0:

sudo cp /lib/systemd/system/serial-getty@.service /lib/systemd/system/serial-getty@.service.backup
sudo sed -i "s/ExecStart=.*/ExecStart=-\/sbin\/agetty --autologin khadas --keep-baud 921600,115200,38400,9600 \%I \$TERM/g" /lib/systemd/system/serial-getty@.service

Reboot to take effect.

If you want to recovery the login prompt, please follow the steps below:

sudo mv /lib/systemd/system/getty@.service.backup /lib/systemd/system/getty@.service
sudo mv /lib/systemd/system/serial-getty@.service.backup /lib/systemd/system/serial-getty@.service
2022/07/06 02:16 · nick