Enabling or Disabling Automatic Login

Ubuntu Desktop normally displays a login screen when you start your computer. You select your user account, authenticate, and then enter the desktop. If you use Ubuntu in a private test environment and do not want to enter your password every time you start it, you can enable automatic login (also called auto-login). Automatic login starts a desktop session for a selected user without requiring that user to enter a login password at startup. You can disable it at any time to restore the normal login screen. In this tutorial, I will show you how to do both using the graphical Settings application.

What you need before you begin

The following procedure uses Ubuntu 24.04 LTS with the default GNOME desktop environment and GNOME Display Manager (GDM). You need an existing local user account and administrator authorization to change the automatic login setting.

On Ubuntu 22.04 LTS, you can find Users directly in Settings rather than under System. If your Ubuntu release uses a different Settings layout, search for Users within the Settings application.

This procedure is for graphical desktop login. A standard Ubuntu Server installation has no graphical login screen, and automatic login at a text console is configured differently. Ubuntu flavors that use a different desktop environment or display manager may also have different settings.

Is automatic login safe?

Automatic login removes the normal authentication barrier at desktop startup. If another person can start the computer or reboot it, they may be able to access the files, applications, and network resources available to the selected user account.

For example, suppose you use an Ubuntu virtual machine for Linux or networking labs. If the host computer is secured and the virtual machine contains no sensitive data, automatic login can make repeated lab restarts more convenient. On a shared workstation or a laptop that you carry outside your home, the same feature creates an unnecessary security risk.

I recommend leaving automatic login disabled on shared computers, work laptops, production administration workstations, and systems that contain sensitive information. If you enable it temporarily for a lab, turn it off again when you finish.

How to enable automatic login in Ubuntu

Step 1: Open the Users settings

Start Ubuntu and sign in normally. If the login screen asks you for your password, enter it to access the desktop.

Press the Super key (usually the Windows logo key), type Settings, and open the Settings application. Scroll down the left sidebar, select System, and then select Users in the right pane.

Ubuntu GNOME Settings showing System in the sidebar and Users in the right pane

Step 2: Unlock the user settings

On the Users page, click Unlock in the upper-right corner if the settings are locked. Ubuntu opens an authentication dialog. Enter the password of the administrator account requested by the dialog and click Authenticate.

A standard user cannot authorize this change using only their own standard-account credentials. If you do not have administrator authorization, ask your system administrator to make the change.

Locked Users settings with the Unlock button, followed by the administrator authentication dialog

Step 3: Turn on Automatic Login

Select the user account that you want Ubuntu to sign in to automatically. If you are configuring another account, look under Other Users.

Find the Automatic Login option and turn its switch on. In the Ubuntu light theme shown below, the switch becomes orange and its circular handle moves to the right.

Automatic Login enabled for the selected Ubuntu user account, with the orange switch in the on position

You do not need to remove the account password. Ubuntu retains it even though you will no longer need to enter it for the initial automatic desktop login.

Step 4: Restart Ubuntu and verify the setting

Save your work. Open the system menu in the upper-right corner of the desktop, click the power icon, and select Restart. Confirm the restart if prompted.

After Ubuntu finishes booting and any required disk-unlock step is complete, it should open the selected user's desktop without presenting the normal graphical login screen.

To check that Ubuntu signed in to the intended account, open Terminal and run:

whoami

The command displays the username associated with the current effective user ID. Compare it with the username of the account you selected in Settings. This is particularly useful on a system with multiple local accounts.

How to disable automatic login in Ubuntu

You can restore password-based desktop login without changing or recreating the user account.

  1. Start Ubuntu and open Settings > System > Users.
  2. Click Unlock if required and authenticate with administrator credentials.
  3. Select the account for which automatic login is enabled.
  4. Turn the Automatic Login switch off. In the light theme, the switch becomes gray and its handle moves to the left.
Automatic Login disabled for the selected Ubuntu user account, with the gray switch in the off position

Save your work and restart Ubuntu. The normal login screen should now appear instead of opening the desktop automatically. Select your account and authenticate as usual.

The following illustration compares the expected startup results when automatic login is enabled and disabled.

Startup comparison showing the Ubuntu desktop with automatic login enabled and the password login screen with automatic login disabled

Does automatic login disable all password prompts?

No. The Automatic Login setting affects the initial graphical desktop sign-in. It does not remove your user password or disable every other form of authentication.

Authentication featureEffect of enabling automatic login
Desktop login at startupUbuntu starts the selected user's desktop session automatically.
Screen lockThe existing screen-lock settings remain separate. You may still need to authenticate after locking the screen or resuming from suspend.
Administrative operationsCommands using sudo and protected system settings can still require authentication according to their normal policies.
Disk encryptionA configured disk-unlock PIN or passphrase may still be required before the desktop starts.
GNOME KeyringThe login keyring may remain locked and request its password when an application needs stored credentials.
Remote loginSecure Shell (SSH) and other remote-access services use their own authentication settings.

A graphical login password is also not a substitute for disk encryption. Without appropriate encryption, someone with physical access may be able to read stored data without using the normal desktop login process.

Keep screen locking enabled, even if you use automatic login. Remember, though, that a locked session does not prevent someone from rebooting a computer with automatic login enabled and obtaining a fresh desktop session.

Troubleshooting automatic login in Ubuntu

The Automatic Login switch is grayed out

Check whether the Users settings are locked. Use Unlock and complete the authentication dialog. If the control is still unavailable, verify that you have administrator authorization and that your organization permits automatic login. Do not bypass a managed system's security policy.

Ubuntu still asks for a password after you enable automatic login

First, identify the prompt. A disk-encryption prompt before the graphical desktop starts or a keyring prompt after the desktop opens is different from the normal account login screen.

If the normal graphical login screen still appears, return to the Users settings, check that automatic login is enabled for the correct account, and restart again. If the problem persists, verify that the system uses the GNOME desktop and GDM. Other display managers can require different configuration procedures.

If a keyring prompt appears after automatic login, enter the keyring password when required. I do not recommend removing keyring password protection simply to eliminate that prompt.

You cannot find the Users option

Search for Users in the Settings application. The location of this page differs between Ubuntu releases and desktop environments. The screenshots in this tutorial show the System > Users layout rather than every available Ubuntu desktop variant.

Enabling or disabling automatic login on RHEL

Red Hat Enterprise Linux (RHEL) also offers graphical automatic login when using an appropriate GNOME desktop configuration. If you administer RHEL, see the related tutorial How to Enable Automatic Login on Linux for the procedure on that distribution.

For additional Ubuntu guidance, see the official Log in automatically and The screen locks itself too quickly help pages. The Ubuntu Desktop installation guide also explains the separate disk-encryption and account-login options.

Conclusion

Automatic login is a convenience feature that lets Ubuntu start a graphical desktop session without asking for the selected user's login password. You can enable or disable it from the Users settings and restart the computer to confirm the result.

For a secured, temporary Linux lab, automatic login can reduce repetitive sign-ins. For everyday system administration, particularly on computers with access to sensitive files or network devices, keep normal login authentication enabled and use screen locking and disk encryption as appropriate.

ComputerNetworkingNotes Ubuntu Tutorials Enabling or Disabling Automatic Login

We do not accept any kind of Guest Post. Except Guest post submission, for any other query (such as adverting opportunity, product advertisement, feedback, suggestion, error reporting and technical issue) or simply just say to hello mail us ComputerNetworkingNotes@gmail.com