在复选框、八进制(如 755)和符号表示法(如 rwxr-xr-x)之间转换 Unix 文件权限。
如何使用 chmod 计算器
为所有者、组和其他勾选读、写和执行复选框。
或输入像 755 这样的八进制值以自动设置复选框。
复制可直接运行的 chmod 命令。
Unix file permissions control who can read, write and execute a file or directory, split across three groups: the owner, the group, and everyone else. This calculator converts between interactive checkboxes, the numeric octal form like 755, and the symbolic form like rwxr-xr-x, keeping all three in sync.
Each group gets three bits, read (4), write (2) and execute (1), and you add them up to get one digit. So 7 is read plus write plus execute (rwx), 5 is read plus execute (r-x), and 6 is read plus write (rw-). Three digits, one per group, give you the familiar permission number.
The common values are worth memorizing. 755 suits directories and executables: the owner has full access while group and others can read and execute but not write. 644 suits normal web files: the owner can read and write, everyone else can only read.
For sensitive files, 600 keeps things tight: only the owner can read or write, and nobody else has any access, which is what SSH private keys and similar secrets need.
There is also an optional fourth leading digit for special bits, setuid, setgid and the sticky bit, which change how programs run or how a shared directory behaves. When one is set, the execute position shows as s or t instead of x.
The calculator gives you the ready-to-run chmod command to copy, and runs entirely in your browser. It is a reference and converter, so it does not change any files itself.
常见问题
755 给予所有者完全访问权限,其他所有人读和执行,用于目录和脚本。644 给予所有者读和写,其他所有人只读,用于普通文件。
777 给予所有人读、写和执行权限。在服务器上几乎总是不安全的,因为任何用户都能修改该文件。建议改用 755 或 644。
添加执行位。从 644 你可以改为 755(或 chmod +x),这会为所有者、组和其他打开执行权限。
八进制(如 755)将权限编码为数字,而符号表示法(rwxr-xr-x 或 u+x)用字母描述。本工具同时显示两者并保持同步。
它们是第四个前导数字。setuid 和 setgid 让程序以其所有者或组的身份运行,目录上的 sticky 位可阻止用户删除彼此的文件(如 /tmp 上)。
当设置了 setuid、setgid 或 sticky 位时,执行位置会显示为 s 或 t 而非 x,以表明特殊位处于活动状态。
嵌入此工具
将此工具添加到你自己的网站。复制下方代码片段即可,它会自动保持最新。
<iframe src="https://monu.tools/embed/zh/chmod-calculator" width="100%" height="640" style="border:1px solid #e5e5e5;border-radius:12px;max-width:680px" loading="lazy" title="Monu Tools"></iframe>相关工具