su
has "lost" setuid permission. What's the output of:ls -l /usr/bin/su
chmod
in particular) that could affect it? chmod 04555 /usr/bin/su
)Hi,
the error states thatsu
has "lost" setuid permission. What's the output of:
Code:ls -l /usr/bin/su
Have you issued any command (chmod
in particular) that could affect it?
Is the partition/disk where /usr/bin is located mounted with the nosuid option?
Do you have access to root account to correct permissions? (chmod +s /usr/bin/su
)
14520 /usr/bin/su
root@freebsd:/home/jamie # chmod +s /usr/bin/su
chmod: /usr/bin/su: Operation not permitted
That's right, sorry, it has the immutable chflag so it needs to be cleared first:chmod: /usr/bin/su: Operation not permitted
chflags noschg /usr/bin/su
chmod 04555 /usr/bin/su
chflags schg /usr/bin/su
We need to see the exact metadata state of the su command. This is what we expect:Code:[strand.246] $ ls -laod /usr/bin/su -r-sr-xr-x 1 root wheel schg,uarch 17232 Apr 9 2021 /usr/bin/su
-r-sr-xr-x 1 root wheel schg,uarch 17232 Apr 9 2021 /usr/bin/su
That's right, sorry, it has the immutable chflag so it needs to be cleared first:
Code:chflags noschg /usr/bin/su chmod 04555 /usr/bin/su chflags schg /usr/bin/su
root@freebsd:/home/jamie # chmod +s /usr/bin/su
chmod: /usr/bin/su: Operation not permitted
/usr/bin/su
It's giving me the same error:What about unadornedsu
?
~$ su
su: Not setuid and you are not root, expect this to fail
root's password:
Thanks.It looks like your shell might be using an inappropriate alias for "su". Depending on your shell, some of these may identify the alias:Also, what happens when you do this:Code:which su whence su alias alias -x
Code:/usr/bin/env - PATH="/bin:/usr/bin" /bin/sh su
~$ which su
su: aliased to nocorrect su
~$ whence su
nocorrect su
su='nocorrect su'
sudo='nocorrect sudo'
~$ alias -x
alias: bad option: -x
$ which su
/usr/local/bin/su
This is what i was thinking but i am paranoid so i didn't post it.Is it possible that this version is hijacking the base "su"? Is it possible that I was hacked?
su
command. su
command got installed might be worth identifying.ls -laod /usr/bin/su /usr/local/bin/su
sum /usr/bin/su /usr/local/bin/su
This is what i was thinking but i am paranoid so i didn't post it.
[strand.296] $ cd /usr/ports
[strand.297] $ find . -name pkg-plist |xargs grep "/su$"
./shells/yash/pkg-plist:%%DATADIR%%/completion/su
./security/logcheck/pkg-plist:%%ETCDIR%%/ignore.d.server/su
./security/logcheck/pkg-plist:%%ETCDIR%%/violations.d/su
./security/heimdal/pkg-plist:bin/su
./sysutils/heirloom/pkg-plist:@(,,4755) %%DATADIR%%/usr/5bin/su
./sysutils/heirloom/pkg-plist:%%DATADIR%%/etc/default/su
I was just about to suggest security/heimdal as the only plausible candidate:Code:[strand.296] $ cd /usr/ports [strand.297] $ find . -name pkg-plist |xargs grep "/su$" ./shells/yash/pkg-plist:%%DATADIR%%/completion/su ./security/logcheck/pkg-plist:%%ETCDIR%%/ignore.d.server/su ./security/logcheck/pkg-plist:%%ETCDIR%%/violations.d/su ./security/heimdal/pkg-plist:bin/su ./sysutils/heirloom/pkg-plist:@(,,4755) %%DATADIR%%/usr/5bin/su ./sysutils/heirloom/pkg-plist:%%DATADIR%%/etc/default/su