If this error occures while you try to su, it means that you need to set SUID bit to su binary like below:
$ su -
su: not running setuid
(BECOME ROOT SOMEHOW AND THEN...)
# ls -l `which su`
-r-xr-x--- 1 root wheel 14324 Apr 12 23:14 /usr/bin/su
# chmod u+s `which su`
# ls -l `which su`
-r-sr-x--- 1 root wheel - 14324 Apr 12 23:14 /usr/bin/su
# su - andrei
$ su -
Password:
So above commands do:
- ls -l `which su` - lists su binary
- chmod u+s `which su` - adds SUID bit to su binary
- exactly like 1.
- su to another user ( andrei in this case)
- su to root from a normal user. See that the error does not occure any more.
notes: instead of `which su` you could use directly /path/to/su/binary if you know it, and you can use `which su` and it'll work on both Linux & FreeBSD.
This error occured after a buildworld. I suspect that because of file flags I use.
No comments:
Post a Comment