I have set up a separate account up on my pi for my brother, but my Pi signs in at startup instead of asking for username and password.

How can I switch off the auto login and prompt for credentials on each boot?

All answers will be appreciated!

  • 2
    What distro are you using? It shouldn't be logging in automatically as pi unless you've done something really strange.
    – goldilocks
    Jan 4 '14 at 11:27
  • you should buy your brother his own SD card, this offers the ultimate data protection and security.
    – lenik
    Jan 5 '14 at 23:56
  • 1
    @goldilocks Doesn't Raspbian have an option for auto-login to desktop in raspi-config? I thought it did, has that changed recently and I missed it? Like user1231's answer below. Shouldn't the Boot-Behaviour option control auto-login? May 7 '14 at 14:27

Call up the Terminal, type sudo raspi-config select boot-behaviour and choose Command Line.

When the Pi starts up, it will show a load of diagnostic reports and then a prompt for a username and password. To then get to the desktop, type startx


The login depends on configuration, I got mine from Maplin (UK) and it is set to auto-login with the 'pi' account and launch the GUI by default, so I would assume that it has been configured like that by the retailer you've got it from (As I saw a lot of questions/articles/etc. about how could one login to the raspberry pi and similar)

One thing that comes in to my mind is reversing this it is for Raspbian, but I think it should work on other distros as well (although not tested)

If you specify the OS distro you are running, I will update with specific instructions

As to explain the process of the reversing the tutorial, just:

  1. sudo nano /etc/inittab
  2. #1:2345:respawn:/sbin/getty 115200 tty1
  3. Remove the hash
  4. If a line like: 1:2345:respawn:/bin/login -f pi tty1 </dev/tty1 >/dev/tty1 2>&1 is presented, I would recommend you to comment it out.

Edit: Based on your feedback in the comments, I googled a bit and found this method (as well I have not tested it):

  1. sudo nano /etc/lightdm/lightdm.conf
  2. Find the line autologin-user=pi
  3. Comment it out and then reboot or power off and on again(CAUTION Do not unplug and plug the RPi, you could damage it.)

This is the last thing I have found, let me know if it worked.

  • I am running Raspbian and I got it as an xmas pressy so I don't know where it was bought.
    – Someone
    Jan 5 '14 at 17:12
  • I have done as you said would work, but it hasn't worked, it is still logging on as 'pi' and I need answers ASAP now because I have something on my account that my brother CANNOT see.
    – Someone
    Jan 5 '14 at 17:44
  • @Someone sorry I didn't reply earlier, but yesterday I was not able to check up with the site Jan 6 '14 at 20:45

This solution works brilliant in Pi4 B model

    sudo nano /etc/lightdm/lightdm.conf
    Find the line autologin-user=pi
    Comment it out and then reboot or power off and on again(CAUTION Do not unplug and plug the RPi, you could damage it.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.