Menno Duursma wrote:
> On Mon, 06 Jun 2005 22:08:21 +0200, PJ Beers wrote:
>
>>If I run su I get the following output:
>>
>>~$ su
>>Password:
>>Sorry.
>
> Check that the permissions on "su" are correct, on my box it looks like:
>
> ~$ ls -l /bin/su
> -rws--x--- 1 root wheel 35780 2004-06-21 21:20 /bin/su*
>
> Which means users should be in the "wheel" group for them to access it at
> all ("menno" is, but "pan" is not, etc.) And as it's a SUID binary when is
> does get run, it will be executed with the privileges of the user owning
> it, rather then the user that spawn it (root in this case).
>
> Try something like:
>
> gpasswd -a pj wheel
> chgrp wheel /bin/su
> chmod 4710 /bin/su
<snip>
On my box, permissions are:
~$ ls -l /bin/su
-rwx--x--x 1 root root 35780 2005-06-05 21:32 /bin/su*
Now I took a risk, and removed and reinstalled the shadow-package (from
Slackware 10.1, the same version as I was using, from which /bin/su
originated). Now I get:
~$ ls -l /bin/su
-rws--x--x 1 root bin 35780 2004-06-21 21:20 /bin/su*
Apparently, I _did_ miss one important part of the permissions, i.e. the
's'-bit. Can it be that the 's'-bits were changed during all the imaging
and resizing operations?
By the way, I never noticed that before, to be honest... Is that what
you called the SUID-bit? How can I set the suid? (Already found that
out, see below.)
Also, if I understand correctly I don't need to make use of the
wheel-group if I leave su executable by others, as it is now...
Anyway, reinstalling the shadow-package did solve the su problem, so
thanks already!
So next... Might the above mean that permissions on mount have changed?
Right now I have:
~$ ls -l /bin/mount
-rwxr-xr-x 1 root root 61308 2005-06-05 21:32 /bin/mount*
and in the original package it says -rwsr-xr-x...
Can it be that imaging and restoring, and/or resizing partitions may
have changed all the suid-permissions to x-permissions? And how do I set
the suid-permission?
Currently my suid-binaries are:
~$ find / -type f -perm +4000 -ls 2>/dev/null
48188 36 -rws--x--x 1 root bin 35780 Jun 21 2004 /bin/su
57940 32 -rws--x--x 1 root bin 29492 Jun 21 2004
/usr/bin/chfn
57941 28 -rws--x--x 1 root bin 27780 Jun 21 2004
/usr/bin/chsh
57942 36 -rws--x--x 1 root bin 34540 Jun 21 2004
/usr/bin/chage
57943 20 -rws--x--x 1 root bin 16652 Jun 21 2004
/usr/bin/expiry
57944 20 -rws--x--x 1 root bin 19948 Jun 21 2004
/usr/bin/newgrp
57945 40 -rws--x--x 1 root bin 37880 Jun 21 2004
/usr/bin/passwd
57946 36 -rws--x--x 1 root bin 34616 Jun 21 2004
/usr/bin/gpasswd
Also, how do I find out which files originally had the suid-bit? I
thought of ~$ cat /var/log/packages/* |grep rws, but that didn't help
<snip>
> Here again "mount" needs root (or actually EUID 0) privileges to work, so
> change the permissions to suid, like:
>
> chgrp wheel /bin/mount
> for p in go-rwx g+x u+srwx ; do chmod $p /bin/mount ; done
Ok, I did the following:
~$ ls -l /bin/mount
-rwxr-xr-x 1 root root 61308 2005-06-05 21:32 /bin/mount*
~$ su
/home/pj# for p in go-rwx g+x u+srwx ; do chmod $p /bin/mount ; done
# exit
exit
~$ ls -l /bin/mount
-rws--x--- 1 root root 61308 2005-06-05 21:32 /bin/mount*
and then changed my mind and did:
/home/pj# for p in go+x g+x u+srwx ; do chmod $p /bin/mount ; done
Anyway, this seems to have helped

Now I can mount the iPod myself
again! Thanks very much, the link to your explanation of chmod did help
alot.
PJ
>
>
>>I googled about the su issue, but the only fix I saw concerned the
>>permissions for su,
>
>
> Which are very likely to be the problem indeed.
>
>
>>and they are correct on my box (I checked against the package from
>>which it originated).
>
>
> Are you really sure about that?
>