User avatar
HawaiianPi
Posts: 5711
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Asking for wong password

Wed May 11, 2016 8:09 pm

Got a new Pi3 and set up a new microSD card with the latest Raspbian Jessie image.

Logged in to the default user account (pi/raspberry) and set up a new user/password and added my new user as a sudoer using visudo, then logged out and back in to my user account (the new user I created).

In my account I installed apps, some of which require superuser/root permissions to run, but the problem is when I try to launch one of those from the GUI, it asks for the default "pi" user password, and not mine.

Let's take gparted as an example. From MY account I installed gparted from the cli (sudo apt-get install gparted) using MY password, and it appears in under "Preferences" in the menu. When I click on it a dialog comes up asking for authentication, but it wants the "pi" user password.

The whole point of setting up my own user account was to use my own name and password, but it seems that Raspbian is set up in some way to not allow that. What's up with that? And is there a fix?

Thanks.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

stderr
Posts: 2178
Joined: Sat Dec 01, 2012 11:29 pm

Re: Asking for wong password

Wed May 11, 2016 8:16 pm

HawaiianPi wrote:In my account I installed apps, some of which require superuser/root permissions to run, but the problem is when I try to launch one of those from the GUI, it asks for the default "pi" user password, and not mine.
What do you mean "from the GUI"? Are you automatically booting into the GUI or did you do something else, like log into your account and type startx ? Because if you are setting the system to automatically log in, it does that to the pi account. You can see this in the source code for raspi-config and the files it links to.

You could correct those issues directly using systemd or you could set the system to not log in automatically and then log in under your account and then see if startx works. Then the gui should be booted under your account and it should ask for your account's password. Obviously this all working assumes you've correctly set up your new account as sudoable and with the proper groups and whatnot.

User avatar
HawaiianPi
Posts: 5711
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Asking for wong password

Wed May 11, 2016 8:34 pm

No, I am not using auto-login. As I said above, I logged into MY account (not "pi"), and installed the software under MY account using MY password. I thought I had made that clear in my original post, but I guess I didn't, so...

No auto login.

Not booting to GUI.

System boots to a command prompt. I login to my account manually, and (when I need it) I use "startx" to launch the GUI.

Thanks.
Last edited by HawaiianPi on Thu May 12, 2016 1:23 am, edited 1 time in total.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

User avatar
HawaiianPi
Posts: 5711
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Asking for wong password

Thu May 12, 2016 1:21 am

More info...

If I use a terminal to launch the app it works as expected (gksu gparted wants my password). It's only when I launch it by clicking on it in the menu that it asks for the "pi" user password.

In the password/authentication dialog that pops up you can click on the "pi" username to open a list and change users, but the only other user in the list is root (which has no password by default in Debian).

My user is a member of all the same groups as the "pi" user (except for the pi group).

Even after rebooting and being the only user logged in, it still asks for the "pi" user password when I try to lauch an app from the desktop menu that requires authentication. I have tried purging the app and reinstalling, but it made no difference.

My temporary solution is to change the pi user passwword to be the same as mine, but that's not really an answer. I was planning on deleting the pi user, but until this can be fixed I guess I can't.

Thanks to anyone that can help.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

ajk
Posts: 9
Joined: Fri May 06, 2016 11:35 pm

Re: Asking for wong password

Thu May 12, 2016 6:48 pm

HawaiianPi wrote: Let's take gparted as an example. From MY account I installed gparted from the cli (sudo apt-get install gparted) using MY password, and it appears in under "Preferences" in the menu. When I click on it a dialog comes up asking for authentication, but it wants the "pi" user password.
Thanks.
The option under "Preferences" calls gparted-pkexec. It differs from gparted in how it determines if the user is authorized to use it.

gparted demands that it is run by root. So in effect it involves using su,sudo,gksudo etc to run it and thus the entries in sudoers.list controls who can or cannot use it.

gparted-pkexec does not need to be run by root and can be run without any sudo privliges. If it is run as root (e.g. sudo gparted etc.) it behaves the same as gparted. If it is not run as root it uses polkit to decide if the user is allowed to use it. Any user who has and account listed in /etc/polkit-1/localauthority.conf.d/60-desktop-policy.conf will be able to use it after they have confirmed their identity by selecting their account and entering their password.

User avatar
HawaiianPi
Posts: 5711
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Asking for wong password

Fri May 13, 2016 3:42 pm

ajk wrote:...
The option under "Preferences" calls gparted-pkexec. It differs from gparted in how it determines if the user is authorized to use it.

gparted demands that it is run by root. So in effect it involves using su,sudo,gksudo etc to run it and thus the entries in sudoers.list controls who can or cannot use it.

gparted-pkexec does not need to be run by root and can be run without any sudo privliges. If it is run as root (e.g. sudo gparted etc.) it behaves the same as gparted. If it is not run as root it uses polkit to decide if the user is allowed to use it. Any user who has and account listed in /etc/polkit-1/localauthority.conf.d/60-desktop-policy.conf will be able to use it after they have confirmed their identity by selecting their account and entering their password.
Interesting. So why is this a problem under Raspbian and not under other Debian based distros? Is it because Raspbian has pre-defined default user, while other distros ask for a username and set up the user account during installation? I've been running Linux as my primary OS for over 10 years and I've not had nearly as many problem as I've had in Raspbian.

They really should eliminate the built-in account and have Raspbian behave like other distros and set up a user defined account. Having a default account with admin rights and no password required is just a really bad idea. You might as well activate the root account and use that.

Thanks for the info on gparted and gparted-pkexec. I'd never run into this problem before and wasn't aware of that difference.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

User avatar
jojopi
Posts: 3233
Joined: Tue Oct 11, 2011 8:38 pm

Re: Asking for wong password

Fri May 13, 2016 4:28 pm

Raspbian itself does not have a pre-defined default user, any more than Debian has. You are just comparing Debian systems that you have installed with a Raspbian system that was installed and configured by someone else and then you downloaded their disk image.

You can install Raspbian yourself (debootstrap) if you want more control. It may be easier to use the Foundation's images and just change the things you do not like.

Return to “Raspberry Pi OS”