ubuntu automatic login

For security reasons, entering the password when logging in is the default behavior on Ubuntu. If other people can power on your system, it’s best to keep this mechanism enabled as they might have access to sensitive information with auto-login.

However, if you’re always the one to boot your system, it’s safe to enable automatic login. This will only skip the login during the initial boot.

If you lock the screen afterward or try to perform actions that require root privileges (e.g., sudo commands), you’ll still be prompted for the password.

Configure Automatic Login from Control Center

Keep in mind that you must be logged in as a sudo user to configure user settings like automatic login. Additionally, you can only enable automatic login for one user at a time. Having said that,

  1. Search ‘settings’ to open the Control Center and switch to the Users tab.
    ubuntu user settings
  2. Click on Unlock and enter your password for authentication. Or if you’re trying to configure it for another user, switch to that user instead.
    unlock user settings ubuntu
  3. Toggle Automatic Login on or off as you prefer.
    automatic login setting ubuntu

Configure Automatic Login via Terminal

If you’re working on a server without a GUI or remotely managing users through SSH, you can edit your display manager’s configs to enable or disable automatic login. In the case of GNOME, you can edit the custom configs file like so

sudo nano /etc/gdm3/custom.conf

Uncomment the AutomaticLoginEnable and AutomaticLogin directives here. Then, replace the username and set auto-login to true or false as you prefer.

AutomaticLoginEnable = true
AutomaticLogin = anup

Save the changes and restart the machine to verify that the new configs work.

As an aside, I’ve seen some users complain that Ubuntu locks the screen if left idle for a while, and you have to enter the password to log back in. 

This is a useful security mechanism, so I don’t recommend changing it. But if you’d like to disable screen-locking anyway, the linked article will guide you with step-by-step instructions.

Anup Thapa

Senior Writer

Anup Thapa is a Linux enthusiast with an extensive background in computer hardware and networking. His goal is to effectively communicate technical concepts in a simplified form understandable by new Linux users. To this end, he mainly writes beginner-friendly tutorials and troubleshooting guides. Outside of work, he enjoys reading up on a range of topics, traveling, working out, and MOBAs.