If a file has permissions 000
, who or what can access the file? What can they do to it?
What, exactly, does 000 (---------)
permissions on a file mean in practice?
You need to use the stat command to view or get octal file permissions for given filename. By default the ls command will not display the permissions on a file in octal form. The permission in octal form is useful for many commands such as chmod command and other sysadmin tasks.
755 means read and execute access for everyone and also write access for the owner of the file. When you perform chmod 755 filename command you allow everyone to read and execute the file, the owner is allowed to write to the file as well.
root can do everything, others (with userid != 0) can't do anything. But anyone who has write access to the containing folder is allowed to delete the file. The owner can of course always change the flags and regain access anytime.
greybox:~ septi$ touch foo greybox:~ septi$ chmod 000 foo greybox:~ septi$ ls -l foo ---------- 1 septi staff 0 Apr 8 12:28 foo greybox:~ septi$ cat foo cat: foo: Permission denied greybox:~ septi$ sudo ls -l foo Password: ---------- 1 septi staff 0 Apr 8 12:28 foo greybox:~ septi$
File with 000 permission can be read / written by root.
Everybody else cannot read / write / execute the file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With