User authorization in Raspbian


13 posts
by cyborg4 » Tue Dec 18, 2012 4:14 pm
Hello,
I have just installed the Raspbian distro after having problems with Win32 DiskImager ( see http://www.raspberrypi.org/phpBB3/viewtopic.php?p=229766), and am now using it fine. However, there are two questions I have about security on the Pi.
  • One, I have noticed that by default the Pi boots automatically into the 'pi' account. How can I prevent this?
  • Two, I have noticed that when I open a root terminal from the automatic logging in 'pi' account, it does not prompt for a password. It comes up with a dialogue box informing me of this, and implies that the setting can be changed, but doesn't say how, which is slightly disconcerting. How can I set it to prompt for authentication?
Image Raspberry Pi = :D :D!
Last edited by cyborg4 on Sun Apr 07, 2013 4:26 pm, edited 1 time in total.
Proud to be 11 years old!
User avatar
Posts: 18
Joined: Sat Dec 08, 2012 4:47 pm
by redhawk » Tue Dec 18, 2012 4:33 pm
One, I have noticed that by default the Pi boots automatically into the 'pi' account. How can I prevent this?


When running Raspbian for the first time it boots into the configuration menu (raspi-config) this is to setup the various things like keyboard language and expanding the root partition to use your entire card rather than the default 2GB.

After a reboot it will prompt you for a username / password (pi / raspberry) (passwords are not echoed on the screen btw).

To change your account password login and enter: passwd
To gain access to the root account you need to change the empty password to one that's set: sudo passwd

Richard S.
User avatar
Posts: 2946
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1
by cyborg4 » Thu Dec 20, 2012 7:08 pm
redhawk wrote:When running Raspbian for the first time it boots into the configuration menu (raspi-config) this is to setup the various things like keyboard language and expanding the root partition to use your entire card rather than the default 2GB.

After a reboot it will prompt you for a username / password (pi / raspberry) (passwords are not echoed on the screen btw).

To change your account password login and enter: passwd
To gain access to the root account you need to change the empty password to one that's set: sudo passwd

Richard S.


I have set Raspbian to auto-boot into the GUI, and it doesn't prompt for a password at logon, nor when using the sudo command at the terminal.
Proud to be 11 years old!
User avatar
Posts: 18
Joined: Sat Dec 08, 2012 4:47 pm
by cyborg4 » Sun Apr 07, 2013 4:32 pm
redhawk wrote:
One, I have noticed that by default the Pi boots automatically into the 'pi' account. How can I prevent this?[/quot
When running Raspbian for the first time it boots into the configuration menu (raspi-config) this is to setup the various things like keyboard language and expanding the root partition to use your entire card rather than the default 2GB.

After a reboot it will prompt you for a username / password (pi / raspberry) (passwords are not echoed on the screen btw).

To change your account password login and enter: passwd
To gain access to the root account you need to change the empty password to one that's set: sudo passwd

Richard S.


Can I get my Pi to prompt for auth when autobooting into the GUI?
Proud to be 11 years old!
User avatar
Posts: 18
Joined: Sat Dec 08, 2012 4:47 pm
by klricks » Sun Apr 07, 2013 7:55 pm
I don't know how or if it can be done but if you are going to go through all the trouble to have it prompt for a user & password then how much harder to type startx after logging in? Might as well turn off auto start......
Go here for my RPi writeup. Basic config, Serial Port add-on etc:
http://home.budget.net/~klricks/Comp/RPi/Rpi.html
Posts: 1030
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
by jojopi » Sun Apr 07, 2013 8:08 pm
cyborg4 wrote:Can I get my Pi to prompt for auth when autobooting into the GUI?
Yes. Edit the display manager configuration with "sudo nano /etc/lightdm/lightdm.conf". Find the line "autologin-user=pi" and comment it out by adding a # at the beginning.
User avatar
Posts: 1873
Joined: Tue Oct 11, 2011 8:38 pm
by cyborg4 » Mon Apr 08, 2013 6:12 am
klricks wrote:I don't know how or if it can be done but if you are going to go through all the trouble to have it prompt for a user & password then how much harder to type startx after logging in? Might as well turn off auto start......



That is what I have currently resorted to, but surely there is an easier way!
:shock:
Proud to be 11 years old!
User avatar
Posts: 18
Joined: Sat Dec 08, 2012 4:47 pm
by cyborg4 » Mon Apr 08, 2013 6:13 am
jojopi wrote:
cyborg4 wrote:Can I get my Pi to prompt for auth when autobooting into the GUI?
Yes. Edit the display manager configuration with "sudo nano /etc/lightdm/lightdm.conf". Find the line "autologin-user=pi" and comment it out by adding a # at the beginning.


Thanks, I'll try this and get back to you.
:)
Proud to be 11 years old!
User avatar
Posts: 18
Joined: Sat Dec 08, 2012 4:47 pm
by NathanBookham » Mon Apr 08, 2013 7:58 am
I don't think that LXDE has an authentication screen. I use MATE on my Pi, and if you set to boot into x, it will ask for a login. You can find the docs here.
This account is now inactive.
I am now known as 'InverseSandwich'
Posts: 65
Joined: Sat Dec 15, 2012 9:18 am
by cyborg4 » Mon Apr 08, 2013 8:11 am
NathanBookham wrote:I don't think that LXDE has an authentication screen. I use MATE on my Pi, and if you set to boot into x, it will ask for a login. You can find the thread here.

LXDE does have an authentication screen - it is displayed when you logout. But thanks anyway! :)
Proud to be 11 years old!
User avatar
Posts: 18
Joined: Sat Dec 08, 2012 4:47 pm
by cyborg4 » Mon Apr 08, 2013 11:30 am
jojopi wrote:
cyborg4 wrote:Can I get my Pi to prompt for auth when autobooting into the GUI?
Yes. Edit the display manager configuration with "sudo nano /etc/lightdm/lightdm.conf". Find the line "autologin-user=pi" and comment it out by adding a # at the beginning.


Thank you, this has now worked! :D
Proud to be 11 years old!
User avatar
Posts: 18
Joined: Sat Dec 08, 2012 4:47 pm
by RichardBronosky » Thu Apr 11, 2013 12:54 am
cyborg4 wrote:it doesn't prompt for a password … when using the sudo command at the terminal


By default the pi user is set up to require no password when running sudo. You can change that by running…
Code: Select all
sudo visudo

… and commenting out this line …
Code: Select all
pi ALL=(ALL) NOPASSWD: ALL


The reason you weren't finding any info on how to fix these things is that your questions are not RaspberryPi specific. Since you are running Raspbian, unless it is a hardware issue you can search for any Debian info and in most cases it will be applicable.

But, I will say that this community should be all about teaching considering the target market for the RaspberryPi. So, don't feel bad for asking here and if you ever get flamed let a moderator know. You, sir, are the reason for all of this, not people like me.
-- Richard Bronosky
2x Raspberry Pi 512MB
User avatar
Posts: 58
Joined: Thu Feb 14, 2013 5:38 pm
Location: Atlanta, GA, USA
by cyborg4 » Thu Apr 11, 2013 9:47 am
RichardBronosky wrote:
cyborg4 wrote:it doesn't prompt for a password … when using the sudo command at the terminal


By default the pi user is set up to require no password when running sudo. You can change that by running…
Code: Select all
sudo visudo

… and commenting out this line …
Code: Select all
pi ALL=(ALL) NOPASSWD: ALL


The reason you weren't finding any info on how to fix these things is that your questions are not RaspberryPi specific. Since you are running Raspbian, unless it is a hardware issue you can search for any Debian info and in most cases it will be applicable.

But, I will say that this community should be all about teaching considering the target market for the RaspberryPi. So, don't feel bad for asking here and if you ever get flamed let a moderator know. You, sir, are the reason for all of this, not people like me.

Thanks Richard, I'll try this today. It's good to know that there are so many friendly people in the community! :)
Proud to be 11 years old!
User avatar
Posts: 18
Joined: Sat Dec 08, 2012 4:47 pm