Take the 2-minute tour ×
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.

Why does this work as root?

# touch test1
# chmod 000 ./test1
# echo "test" > ./test1

I take it root is not affected by file permissions?

share|improve this question
add comment

1 Answer

http://superuser.com/questions/104015/removing-write-permission-does-not-prevent-root-from-writing-to-the-file

This has the answer.

Root has rw on all files. You can mark a file immutable with

chattr +i filename

removing that is

chattr -i filename
share|improve this answer
6  
Not quite correct. Root has rw, but not x (unless it is a directory). sprunge.us/FNMb –  Chris Down Jul 19 '13 at 16:01
    
Thanks for the edit –  JasonG Jul 19 '13 at 18:32
add comment

Your Answer

 
discard

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.