šŸŽ New User? Get 20% off your first purchase with code NEWUSER20 Register Now →
Menu

Categories

Linux File Permissions Explained: chmod, chown, and ACLs for System Admins

Linux File Permissions Explained: chmod, chown, and ACLs for System Admins

File permissions are the foundation of Linux security. Every file and directory has an owner, a group, and a set of permissions.

Permission Notation

ls -la /var/www/
drwxr-xr-x  5 www-data www-data 4096 Mar 18 html
-rw-r--r--  1 www-data www-data  612 Mar 18 index.html

chmod

chmod 755 script.sh
chmod 644 config.ini
chmod 600 id_rsa
chmod u+x script.sh
chmod g+w shared-file.txt

chown

sudo chown www-data:www-data /var/www/html/ -R
sudo chgrp developers /opt/project/ -R

Special Permissions

chmod 4755 /usr/bin/passwd   # SUID
chmod 2775 /opt/shared/      # SGID
chmod 1777 /tmp/             # Sticky bit
find / -perm -4000 -type f 2>/dev/null

POSIX ACLs

setfacl -m u:john:rwx /opt/project/
getfacl /opt/project/
setfacl -d -m g:developers:rwx /opt/project/

Explore our Linux eBook collection.

Share this article:
Dargslan Editorial Team (Dargslan)
About the Author

Dargslan Editorial Team (Dargslan)

Collective of Software Developers, System Administrators, DevOps Engineers, and IT Authors

Dargslan is an independent technology publishing collective formed by experienced software developers, system administrators, and IT specialists.

The Dargslan editorial team works collaboratively to create practical, hands-on technology books focused on real-world use cases. Each publication is developed, reviewed, and...

Programming Languages Linux Administration Web Development Cybersecurity Networking

Stay Updated

Subscribe to our newsletter for the latest tutorials, tips, and exclusive offers.