Bit Breakdown for 755
Owner (7)
4 + 2 + 1 = 7
rwx (Read, Write, Exec)
Group (5)
4 + 0 + 1 = 5
r-x (Read, Exec)
Others (5)
4 + 0 + 1 = 5
r-x (Read, Exec)
When to Use chmod 755
- Web Server Folders: Public HTML directories such as
/var/www/htmlrequire 755 so that the web server daemon (www-data,nginx, orapache) can enter and serve assets. - Shell & Python Scripts: Any CLI script that multiple users need to execute without being able to modify or tamper with the script logic.
- Shared Binaries: Custom binaries installed in
/usr/local/binor project bin directories.
Practical Command Examples
// Make a bash script executable by owner and readable by all
chmod 755 /usr/local/bin/backup.sh
// Apply 755 recursively only to all directories under /var/www
find /var/www/html -type d -exec chmod 755 {} +
Difference Between chmod 755 and chmod 644
The fundamental difference is the execute permission (1). With 755, everyone can execute the file or traverse the folder. With 644, no one has execute rights; only reading and editing are permitted.