On an Ubuntu Linux I have a directory with the setuid bit set (drwsr-xr-x
) which I want to unset.
Neither chmod 755
nor chmod 0755
nor chmod 00755
(I though maybe the first 0 is interpreted as just "this is octal") cleared the setuid bit. However, chmod u-s
did.
What is the correct numeric mode to clear the setuid bit?
Best Answer
Interestingly. this seems to be impossible using GNU
chmod
, and that's a feature. From theinfo
entry onchmod
on my system; note how, whilst the entry on setting the bits makes reference to symbolic and numeric modes, the entry on clearing them refers only to symbolic (ug-s
) mode: