How to set chmod, so that ONLY owner of the file can read, write and execute? (other users cannot read, write, and execute)
Permissions of 644 mean that the owner of the file has read and write access, while the group members and other users on the system only have read access.
444 = (r-- r-- r--): owner/group/others are all only able to read the file. They cannot write to it or execute it.
Some file permission examples: 777 - all can read/write/execute (full access). 755 - owner can read/write/execute, group/others can read/execute. 644 - owner can read/write, group/others can read only.
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.
chmod 600 filename
will do it;
or
chmod 700
if it is an executable.
Another way that is less cryptic is:
chmod go-rwx filename
For the sake of completeness:
You can do the following command on the file:
chmod 744 filename
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