5

Why can't root execute when executable bits are not set?

view full story
linux-howto

http://unix.stackexchange.com – 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 cannot execute a file when its execute permissions are not set. Why? 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 #!/bin/bash echo hello root$ ./file (HowTos)