jviezel
Posts: 2
Joined: Tue Feb 19, 2013 12:30 am

Change default userid when auto logging in

Tue Feb 19, 2013 12:47 am

Hello Raspberry Pi community!

I configured my Raspbery Pi with Raspbian Wheezy to auto login to the LXDE GUI and used the configuration utility to change the default password for userid "pi" from "raspberry" to something more secure.

I also managed to create a more personalized userid and add it to the necessary groups and even figured out how to give this new userid permission to execute "sudo" commands.

What I can't figure out after extensive Google searches is how to configure the OS to automatically log me into the new userid I created when I boot the device instead of automatically logging me on as "pi". Or, at a minimum, prompt me with a login screen (like my Kubuntu machine does) and let me choose which user to login as. Currently, the device automatically logs me in as "pi" and I then need to logoff and log back in as the new userid I created (very cumbersome).

Any help would be greatly appreciated - thank you!

User avatar
penguintutor
Posts: 386
Joined: Tue May 08, 2012 9:11 am
Location: UK
Contact: Website

Re: Change default userid when auto logging in

Tue Feb 19, 2013 10:54 am

Edit the file /etc/lightdm/lightdm.conf as root

change

Code: Select all

autologin-user=pi
to your new username.

jviezel
Posts: 2
Joined: Tue Feb 19, 2013 12:30 am

Re: Change default userid when auto logging in

Wed Feb 20, 2013 9:25 pm

This worked perfectly and had exactly the desired outcome - thank you for your help.

amyren
Posts: 91
Joined: Tue Jun 12, 2012 10:49 am

Re: Change default userid when auto logging in

Thu Feb 21, 2013 6:39 am

On a wheezy from 09.feb.13, I first set the raspi-config to autostart to x, but changed that later to not auto launch startx. This because I wanted it to boot into the shell environment so I could choose myself to boot into xbmc or desktop.

Vut I dont want to enter the user and passwork on every boot
, so I tried this solution. But for some reason the pi still asks for user / pass after setting the autologin-user = pi in the lightdm.conf.

User avatar
penguintutor
Posts: 386
Joined: Tue May 08, 2012 9:11 am
Location: UK
Contact: Website

Re: Change default userid when auto logging in

Mon Feb 25, 2013 4:58 pm

@amyren Updating lightdm will not work on a console. lightdm is the login manager for the GUI.

If you want to auto-login to a shell then you need to use use the login script within inittab. The following is based on how the raspi-config is launched on first run. I haven't tried this myself and if there is a problem it may stop you from logging on - so make sure you have a backup of anything important first.

make a copy of /etc/inittab (eg. sudo cp /etc/inittab /etc/inittab.bak)
edit the file /etc/inittab as root

comment out the entry (by putting a # at the beginning):

Code: Select all

1:2345:respawn:/sbin/getty --noclear 38400 tty1
add the entry

Code: Select all

1:2345:respawn:/bin/login -f pi tty1 </dev/tty1 >/dev/tty1 2>&1
If this doesn't work then you may need to restore / edit the /etc/inittab file
You can insert the SD card into a Linux PC (download a USB image / CD if you don't already have Linux on a PC) and copy the old inittab back into place (although note that you need to edit the inittab on the SD card and not on your Linux distribution (eg. /media/<sdcardname>/etc/inittab).

Return to “Beginners”