Skip to content

Knowledge Base

Understanding Linux ownership and file permissions

Linux evaluates permissions for the owning user, owning group, and everyone else. Read them with stat FILE or ls -l. The numeric modes 4, 2, and 1 represent read, write, and execute.

chown -R appuser:appgroup /srv/app
find /srv/app -type d -exec chmod 750 {} +
find /srv/app -type f -exec chmod 640 {} +

These are examples, not universal web-server values. Execute permission on a directory controls traversal, while execute on a regular file permits execution. Avoid chmod -R 777: it hides the ownership problem and lets any local account modify the content.

On SELinux systems, correct Unix modes may still be insufficient; inspect denials and assign the appropriate context instead of disabling SELinux blindly.

Please rate this article to help us improve our Knowledge Base.

0 0