Linux File Permissions: A Practical chmod and chown Guide
One of the easiest Linux commands to memorize is chmod.
One of the easiest Linux commands to misuse is also chmod.
When an application cannot read a file or a script refuses to execute, changing everything to 777 might seem convenient. However, it creates an unnecessarily broad access policy.
Understanding permissions makes troubleshooting much easier.
Reading Linux permissions
Start with:
ls -l
Enter fullscreen mode
Exit fullscreen mode
Consider this example:
-rw-r----- 1 www-data adm 1024 Nov 22 access.log
Enter fullscreen mode
Exit fullscreen mode
The first character describes the object type. The next nine characters contain three permission groups:
Owner: rw-
Group: r--
Others: ---
The owner can read and modify the file. Members of the assigned group can read it.…