Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

root user can write to a file even if its write permissions are not set.

root user can read a file even if its read permissions are not set.

root user can cd into a directory even if its execute permissions are not set.

root user cannot execute a file when its execute permissions are not set.


user$ echo '#!'$(which bash) > file
user$ chmod 000 file
user$ ls -l file
---------- 1 user user 12 Jul 17 11:11 file
user$ cat file                      # Normal user cannot read
cat: file: Permission denied
user$ su
root$ echo 'echo hello' >> file     # root can write
root$ cat file                      # root can read
echo hello
root$ ./file                        # root cannot execute
bash: ./file: Permission denied
share|improve this question

1 Answer 1

up vote 21 down vote accepted

In short, because the execute bit is considered special; if it's not set at all, then the file is considered to be not an executable and thus can't be executed.

However, if even ONE of the execute bits is set, root can and will execute it.


caleburn: ~/ >cat

echo "Hello!"

caleburn: ~/ >chmod 000
caleburn: ~/ >./
-bash: ./ Permission denied
caleburn: ~/ >sudo ./ 
sudo: ./ command not found

caleburn: ~/ >chmod 100
caleburn: ~/ >./
/bin/sh: ./ Permission denied
caleburn: ~/ >sudo ./ 
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.