Chmod 权限计算器
计算 Unix 文件权限的符号和数字表示法
读取 (r) | 写入 (w) | 执行 (x) | 八进制 | |
|---|---|---|---|---|
| 所有者 | 7 | |||
| 组 | 5 | |||
| 其他 | 5 |
八进制
755
符号表示
rwxr-xr-x
命令
chmod 755 filename
权限说明
| 符号表示 | 八进制 | 权限说明 |
|---|---|---|
| r | 4 | 读取 |
| w | 2 | 写入 |
| x | 1 | 执行 |
| rw- | 6 | 读取 + 写入 |
| r-x | 5 | 读取 + 执行 |
| rwx | 7 | 读取 + 写入 + 执行 |
继续下一步
用相关的下一个操作延续你的工作流程。
八进制
755
符号表示
rwxr-xr-x
Enabled bits
7/9
结果
成功
Privacy & Trust
Least privilege matters
Start from the minimum required access and add permissions only when the file or directory genuinely needs them.
Files and directories differ
A file often uses 644 while executable scripts or directories frequently need 755. The right default depends on how the path is used.
Client-side calculator
Permission calculations stay in the browser, which is helpful when reviewing internal deployment conventions or shell snippets locally.
Export command
Copy the octal value, symbolic string, or full `chmod` command, or download a plain-text summary.
使用方法
输入数值
在输入栏中填入您的数字或参数。
即时获取结果
结果在您输入时自动更新——无需按计算按钮。
复制或保存
将结果复制到剪贴板或用于您的工作流程。
为什么使用此工具
100% 免费
核心工具可免费使用;AI 及云端工具可能设有每日用量限制。
无需安装
完全在浏览器中运行。无需下载或安装任何软件。
隐私且安全
本地工具把输入留在设备;需要传送数据的工具会清楚标示。
支持移动设备
完全响应式设计——在手机、平板或桌面电脑上均可使用。
Unix File Permissions: Understanding chmod and Access Control
Key Takeaways
- Unix permissions use three octal digits representing read (4), write (2), and execute (1) for owner, group, and others.
- Incorrect file permissions are a leading cause of security vulnerabilities in web servers and application deployments.
- All permission calculations happen in your browser — no system information is accessed or transmitted.
Unix file permissions control who can read, write, and execute files and directories on Linux, macOS, and other Unix-like systems. The chmod command and its numeric notation are essential knowledge for system administrators, DevOps engineers, and anyone deploying web applications. Incorrect permissions can either lock out legitimate access or expose sensitive files to unauthorized users.
20%+
Of server compromises involve 777
Key Concepts
Permission Triplets
Each file has three permission sets: owner (u), group (g), and others (o). Each set can have read (r=4), write (w=2), and execute (x=1). The sum gives the octal digit: rwx = 7, rw- = 6, r-x = 5.
Symbolic vs. Numeric Mode
Symbolic: chmod u+x file (add execute for owner). Numeric: chmod 755 file (rwx for owner, rx for group and others). Numeric mode sets all permissions at once; symbolic mode modifies specific bits.
Directory Permissions
For directories, read (r) allows listing contents, write (w) allows creating/deleting files, and execute (x) allows entering the directory. A common secure setting is 755 for directories and 644 for files.
Special Permissions
SUID (4xxx) runs a file as its owner. SGID (2xxx) runs as its group or inherits group on directories. Sticky bit (1xxx) on directories prevents users from deleting others' files (used on /tmp).
Pro Tips
Use 644 (-rw-r--r--) for regular files and 755 (drwxr-xr-x) for directories as your secure default.
Never use 777 in production — it allows anyone to read, write, and execute. Find a more restrictive permission that meets your needs.
Web server files should be owned by the web server user (www-data, nginx) with 640 or 644 permissions.
Use umask to set default permissions for newly created files — a umask of 022 results in 755 for directories and 644 for files.
All permission calculations are performed entirely in your browser. No system files or permissions are accessed or modified. This tool is for calculation and education purposes only.