11

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
}
Jacobm001
  • 11,898
  • 7
  • 46
  • 56
zenbike
  • 2,490
  • 6
  • 19
  • 26

1 Answers1

9

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.

Alex Chamberlain
  • 15,530
  • 14
  • 67
  • 113
  • 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 http://raspberrypi.stackexchange.com/questions/586/auto-start-x-windows-gdm-on-the-standard-debian-build for info on how to make it start xwindows on startup. – Steve Robillard Jul 28 '12 at 17:53
  • Installing Slim rather than LightDM, allowed me to use xwindows on start up, while still requiring a user login before accessing the machine. Still can't get LightDM to do that. – zenbike Jul 30 '12 at 14:59
  • @zenbike I keep meaning to try lightdm, so I'll try it when I get back from Italy and see if I can make it bow to my commands. – Alex Chamberlain Jul 30 '12 at 18:22