Add login screen to Raspberry Pi desktop

The Raspberry Pi desktop boots into auto login by default. This is ideal for a hobbyist or single users who is not worried about access to the device but not in a case were you have multiple users or can’t trust having a computer device with open access.

It can be easily fix by commenting out a line in the config file of lightdm. Open it with your favourite text editor. We will use nano here, for simplicity sake.

sudo nano /etc/lightdm/lightdm.conf

Look for the line; auto-login-user=pi and prefix it with a hash(#). It should now look like this: #auto-login-user=pi. Your username

Save the file and reboot by typing sudo reboot into your terminal and hit the enter key.

You should now be prompted to add your username and password when you Pi boots into desktop.

Leave a Reply