Quantu
Posts: 18
Joined: Sat Nov 19, 2016 4:13 pm

sudo fiasco

Fri Feb 24, 2017 7:47 pm

hello i seem to have new problems. i was trying to get the permissions for the pi account to open certain commands (which for some reason it didnt even allow when i ran the command while i did sudo su before?) and now i have sudo problems. i managed to fix sudo through pkexec. but guess what.

Code: Select all

pkexec must be setuid root
when running pkexec as normal pi acc.
the same result when running 'gparted-pkexec'. is there any way to fix this problem?
(like reinstalling pkexec and the programs with pkexec?or reinstalling anything with sudo like gksu, sudo itselfs, sudoers(if there is) gksudo and pkexec?)

thanks in advance.

epoch1970
Posts: 5132
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: sudo fiasco

Sat Feb 25, 2017 12:33 am

That doesn't sound too good... If you're able to login as root on the machine, then here are the owner/permissions for pkexec and a list of executables that should as well belong to root and be set suid, as found on my Raspbian Lite machine:

Code: Select all

admin@berck:~ $ which /usr/bin/pkexec 
/usr/bin/pkexec
admin@berck:~ $ stat -c "%a %u %g %n" /usr/bin/pkexec 
4755 0 0 /usr/bin/pkexec
admin@berck:~ $ find /usr/bin -user 0 -perm 4755
/usr/bin/pkexec
/usr/bin/passwd
/usr/bin/chsh
/usr/bin/newgidmap
/usr/bin/gpasswd
/usr/bin/newgrp
/usr/bin/newuidmap
/usr/bin/ksu
/usr/bin/chfn
/usr/bin/sudo
HTH
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

Quantu
Posts: 18
Joined: Sat Nov 19, 2016 4:13 pm

Re: sudo fiasco

Sat Mar 04, 2017 2:25 pm

epoch1970 wrote:That doesn't sound too good... If you're able to login as root on the machine, then here are the owner/permissions for pkexec and a list of executables that should as well belong to root and be set suid, as found on my Raspbian Lite machine:

Code: Select all

admin@berck:~ $ which /usr/bin/pkexec 
/usr/bin/pkexec
admin@berck:~ $ stat -c "%a %u %g %n" /usr/bin/pkexec 
4755 0 0 /usr/bin/pkexec
admin@berck:~ $ find /usr/bin -user 0 -perm 4755
/usr/bin/pkexec
/usr/bin/passwd
/usr/bin/chsh
/usr/bin/newgidmap
/usr/bin/gpasswd
/usr/bin/newgrp
/usr/bin/newuidmap
/usr/bin/ksu
/usr/bin/chfn
/usr/bin/sudo
HTH

Code: Select all

root@RaspPi:/home/pi# stat -c "%a %u %n" /usr/bin/pkexec
755 0 /usr/bin/pkexec
is there a way to set perms to 4755 like normal?

User avatar
DougieLawson
Posts: 39121
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: sudo fiasco

Sat Mar 04, 2017 2:33 pm

sudo chmod +s /usr/bin/pkexec
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Return to “Troubleshooting”