Home Raspberry Pi OS How to disable auto login in Raspberry Pi

How to disable auto login in Raspberry Pi

by Tony G
disable auto login in raspberry pi

When you first install the official Raspberry Pi OS on your Pi, you will notice that it automatically logs you in when you power on the Pi. Many IoT projects benefit greatly from this auto logging-in feature because it takes the user directly to their desktop. However, while this is beneficial, especially when a program is running in the background, it is also dangerous because it poses a security risk.

A Raspberry Pi auto login presents a security issue because anyone who physically gains access to the device, be they hackers or anyone else, can view all of the computer’s data, including files, documents, applications, and any networks to which it is linked to.

Disabling auto login in Raspberry pi

This guide will go over how to disable auto login in Raspberry Pi. To do so, the user can employ two methods;

  1. Graphical User Interface (GUI).
  2. Command Line Interface (CLI).

Let’s get started!

METHOD 1: Disable Auto Login using the graphical user interface.

If you are not a terminal person or just starting with Linux systems and wish to disable auto login in your Raspberry pi, then using the graphical user interface (GUI) would be the best option. This is because the GUI method is usually user-friendly and convenient for beginners compared to the command line interface, which requires lots of technical know-how, skills, and experience.

GUI users typically have windows that let them see, control, manipulate, and navigate through several programs and directories, utilizing windows, icons, and menus until they find what they need. Therefore, if you need to disable auto login using GUI, follow the following steps;

Launch Raspberry Pi Configuration from the main menu.

1. First, click on the Raspberry Pi logo on the top left-hand side of the screen, and the main menu will appear.

2. Scroll your cursor and select “Preferences.”

3. Once you click on preferences, another dropdown menu will appear where you must select “Raspberry Pi Configuration.”

raspberry pi configuration

Raspberry pi configuration

Disable auto-login

1. On the Raspberry pi configuration, you will see different tabs, including; System, Display, Interface, Performance, and Localization. Select the “System” tab.

2. On the System’s tab screen, you will see that “Auto Login” has been automatically enabled. Change it to disabled by clicking the toggle button and clicking “OK.”

disable auto login

Disable auto-login

Reboot the Raspberry pi to save changes

Because it does not have a save changes button, you will be required to reboot your Raspberry pi for the changes to be effective. To do so;

1. Access the main menu by clicking the Raspberry Pi logo in the top-left corner of the screen.

2. Next, scroll the cursor and select the “Shutdown” button.

Reboot Raspberry pi

Reboot Raspberry pi

3. Once you do that, you will be presented with three shutdown options: Shutdown, Reboot, and logout. Next, click on “Reboot.”

shutdown options

Shutdown options

4. Once your Pi is back up, you will see a login window containing your username and password:

  • By default, it will reflect the raspberry Username  “pi.”
name and password window

Name and password window

5. But if you wish to log in as another user, click on the dropdown menu and select “other” to save another name. When through, type your password and log in.

change name

Change name

METHOD 2: Disable Auto-login using the command line interface.

Another alternative to disable auto login in Raspberry pi is the command line interface. This is the terminal way. It’s an effective method because it produces immediate results. To disable the auto login using CLI, follow the instructions below:

Execute the command below to launch the Raspberry pi software configuration tool

sudo raspi-config

Next, select the system options to configure the system’s settings.

system options

system options

Scroll down and select the Boot/Auto login option.

boot options

Boot options

The “boot/auto” login gives you two options:

  • Boot into Console (B1 and B2)
  • Boot into Desktop (B3 and B4)

This post deals with the graphical user interface or the desktop. Therefore, we will need to select the Desktop option that prompts user login. In this case, it’s “B3 Desktop – Desktop GUI, requiring user to login.” Use the arrow keys to select this option.

b1 console

B1 Console

When through, use the tab key to select “OK” and press enter for changes to be effective. When you do that, you will be taken back to the system options; click ‘finish”, and you will be presented with a question asking if you would like to reboot now or not. Choose “yes.”

reboot option

Reboot option

When your Raspberry Pi is back up, you will see a login prompt where you must type your password to log into your system.

Wrapping up

Up to this point, I believe you were able to disable auto login in your Raspberry pi successfully. Auto-login in Raspberry pi can come in handy for specific tasks and applications. However, it can also be a security issue if someone gets their hands on the Pi. Did you encounter any problems disabling the auto-login option in your Raspberry pi? If you did, feel free to leave a comment.

You may also like

Leave a Comment

* By using this form you agree with the storage and handling of your data by this website.