10

Regardless of whether I boot to a GUI or to the console, I always want a password enabled on all of my machines.

I've looked at as many tutorials as I can find regarding this, and although there are apparently a myriad of ways to make debian boot to x and login automatically, I'm not using any of them that I can see. When I use the raspi-config script to set to boot GUI on startup, it bypasses my user password entry. As I have more than one user, this does not work.

So this question is, "How do I securely boot into x-server, maintaining a password before entering the GUI on Raspbian?"

EDIT:

The code on the line beginning 'sed' appears to set an auto-login function, if I don't misunderstand?

do_boot_behaviour() {
  whiptail --yesno "Should we boot straight to desktop?" 20 60 2
  RET=$?
  if [ $RET -eq 0 ]; then # yes
    update-rc.d lightdm enable 2
    sed /etc/lightdm/lightdm.conf -i -e "s/^#autologin-user=.*/autologin-user=pi/"
    ASK_TO_REBOOT=1
  elif [ $RET -eq 1 ]; then # no
    update-rc.d lightdm disable 2
    ASK_TO_REBOOT=1
  else # user hit escape
    return 1
  fi
}
  • Do you have GDM installed then? – Jivings Jul 28 '12 at 9:38
  • How do I figure out what packages I would need? And it appears that the raspi-config script is doing this, unless I misunderstand? See edited question for code snippet. – zenbike Jul 28 '12 at 13:26
  • 1
    Please check the answer. It will help site stats. – xxmbabanexx Apr 21 '13 at 17:07
8

In /etc/lightdm/lightdm.conf, find the line that says

autologin-user=pi

and comment it out; it should look like

#autologin-user=pi

You will have to do this as root.

  • I've done this over SSH, but I will have to wait until I get home from work to check its efficacy. I'll let you know. Did you get that location from the code above, or did you know this some other way? – zenbike Jul 28 '12 at 14:28
  • It's the 'sed' line. Basically saying to replace the commented auto-login line in that file with an uncommented one and a specified user. Right? – zenbike Jul 28 '12 at 14:30
  • @zenbike Right, I deduced the solution from the sed script. – Alex Chamberlain Jul 28 '12 at 15:33
  • So, while it does cause the pi to require a login, it does not use GDM, rather, the login is required in the console, and the GUI no longer starts until I manually input startx. – zenbike Jul 28 '12 at 15:44
  • @zenbike see this question raspberrypi.stackexchange.com/questions/586/… for info on how to make it start xwindows on startup. – Steve Robillard Jul 28 '12 at 17:53

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.