How to set user autologin on Raspberry Pi

Since a Raspberry Pi is commonly used as a test system rather than part of a production environment, you may not need any kind of advanced security on the device. For example, you may get tired of typing your password every time you want to log in to the Raspberry Pi, and wish to bypass these prompts completely. Doing so would be inherently less secure, but in some situations, flouting the security convention may be irrelevant. It is possible to bypass both the GUI and/or console login prompts on the Raspberry Pi.

In this tutorial, you will see how to set a user to automatically log in to a Raspberry Pi. This will include instructions for command line and GUI, depending on whether you run a desktop environment on your device or simply use the console for everything. Let’s see how to do it.

In this tutorial you will learn:

  • How to turn auto login on or off for desktop GUI
  • How to turn auto login on or off for command line console
How to set user autologin on Raspberry Pi
How to set user autologin on Raspberry Pi
Software Requirements and Linux Command Line Conventions
Category Requirements, Conventions or Software Version Used
System Raspberry Pi
Software raspi-config
Other Privileged access to your Linux system as root or via the sudo command.
Conventions # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
$ – requires given linux commands to be executed as a regular non-privileged user

How to set user autologin on Raspberry Pi step by step instructions



WARNING
Being presented with a password prompt when your Raspberry Pi first boots up is a security feature. Keep this in mind before you decide to disable it. In reality, this prompt does very little to protect your Raspberry Pi, and a knowledgeable attacker will be able to access your files through other means, unless the system is properly secured. Still, it is a good way to deter prying eyes in some situations.
  1. Start by opening a command line terminal and opening the raspi-config utility.
    $ sudo raspi-config
    
  2. Next, head into ‘System Options.’
    Opening System Options from raspi-config
    Opening System Options from raspi-config
  3. Then, open up the ‘Boot / Auto Login’ menu.
    Opening the Boot / Auto Login menu in raspi-config utility
    Opening the Boot / Auto Login menu in raspi-config utility
  4. On the next menu, we are able to choose whether we want automatic login configured for the console and desktop GUI. All you need to do is select the option you want to configure and press Enter. Your settings will be saved. Be sure to select your desired configuration for both options (console and GUI).



    Select whether to automatically log in to the GUI or console, or both
    Select whether to automatically log in to the GUI or console, or both

Closing Thoughts

In this tutorial, we saw how to configure auto login for a Raspberry Pi. This setting allows us to configure auto login for both console and desktop GUI, and is simply a matter of convenience for the user. Some users wish to sacrifice the little bit of extra security so that they do not need to type their password every time the Raspberry Pi boots back up. The choice is yours.



Comments and Discussions
Linux Forum