tool::chmod-detail
chmod 644
rw-r--r--
Standard Regular File
Permission Structure
Owner (User)
✓Read (r)
✓Write (w)
✗Execute (x)
Group
✓Read (r)
✗Write (w)
✗Execute (x)
Others
✓Read (r)
✗Write (w)
✗Execute (x)
Octal
644Symbolic
rw-r--r--Explanation
chmod 644 gives the owner read and write permissions while group and others get read-only access. This is ideal for static files served by a web server such as HTML, CSS, JavaScript, and configuration files. No execute bit means the file cannot be run as a script, reducing misuse risk.
Common Use Cases
- ▸Web server HTML/CSS/JS static files
- ▸Public configuration files (nginx.conf, apache2.conf)
- ▸Log files (readable but not executable)
- ▸Shared documents and text files
- ▸Regular source code files in a Git repository
Security Considerations
644 is ideal for web files. The absence of the execute bit (x) reduces the risk of web shell attacks. For configuration files containing passwords or API keys, use 600 or 640 instead of 644. Use find to bulk-validate file permissions in your web root.
Command Examples
$ chmod 644 index.html style.css app.js$ find /var/www -type f -exec chmod 644 {} \;$ chmod 644 /etc/nginx/nginx.conf$ chmod 644 README.md package.jsonRelated Permissions
ad · 300×250
// related tools