Page 1 of 1

sudo fiasco

Posted: Fri Feb 24, 2017 7:47 pm
by Quantu
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.

Re: sudo fiasco

Posted: Sat Feb 25, 2017 12:33 am
by epoch1970
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

Re: sudo fiasco

Posted: Sat Mar 04, 2017 2:25 pm
by Quantu
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?

Re: sudo fiasco

Posted: Sat Mar 04, 2017 2:33 pm
by DougieLawson
sudo chmod +s /usr/bin/pkexec