RackNerd Billboard Banner

How to enable and disable automatic login on Ubuntu Linux via the GUI and CLI

Ubuntu makes it easy to manage user login settings, including automatic login. Whether you’re streamlining a home setup or locking down a shared machine, here’s how to enable or disable auto login using both the graphical interface and the command line.


🔧 Method 1: Enable/Disable Automatic Login via the GUI

This is the easiest route if you’re using Ubuntu Desktop.

✅ Enable Automatic Login

  1. Open Settings (gear icon in the system menu).
  2. Scroll down and select Users.
  3. Click Unlock (top-right) and enter your password.
  4. Select the user account you want to modify.
  5. Toggle Automatic Login to ON.

❌ Disable Automatic Login

Just reverse the process:

  • Go to Settings > Users.
  • Select the user.
  • Toggle Automatic Login to OFF.

That’s it. Simple, fast, done.


💻 Method 2: Enable/Disable Automatic Login via the Command Line

If you’re working remotely, configuring headless systems, or just prefer the terminal, here’s how to do it using the CLI.

🔍 Step 1: Open a Terminal

You’ll need superuser privileges, so prefix with sudo as needed.

✅ To Enable Automatic Login:

  1. Edit the GDM custom configuration file: sudo nano /etc/gdm3/custom.conf
  2. Uncomment or add these lines under the [daemon] section: [daemon] AutomaticLoginEnable = true AutomaticLogin = your-username
  3. Save and exit (Ctrl + O, Enter, then Ctrl + X).
  4. Reboot: sudo reboot

Replace your-username with your actual Ubuntu username.

❌ To Disable Automatic Login:

Just set AutomaticLoginEnable to false:

[daemon]
AutomaticLoginEnable = false

Then save, exit, and reboot.


🧠 Bonus Tip: Check Current Settings

To verify if auto login is active without opening a config file:

grep -i automatic /etc/gdm3/custom.conf

Final Notes

Automatic login is convenient, but it bypasses password security at startup. If you’re on a shared or sensitive system, it’s best left off. That said, for a kiosk, media center, or VM, it’s a time-saver.

Need to automate this via a script or during provisioning? Let me know—I can help write that too.

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
RackNerd Billboard Banner
0
Would love your thoughts, please comment.x
()
x
Copy link