Monu Tools

Máy tính chmod

Chuyển đổi quyền tệp Unix giữa hộp đánh dấu, bát phân (như 755) và ký hiệu tượng trưng (như rwxr-xr-x).

Cách dùng Máy tính chmod

  1. 01

    Đánh dấu các hộp đọc, ghi và thực thi cho chủ sở hữu, nhóm và khác.

  2. 02

    Hoặc gõ một giá trị bát phân như 755 để đặt các hộp tự động.

  3. 03

    Sao chép lệnh chmod sẵn sàng chạy.

What Unix permissions are

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.

How the numbers work

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.

Common values worth knowing

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.

Special bits and the fourth digit

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.

How to use the output

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.

Câu hỏi thường gặp

755 và 644 nghĩa là gì?

755 cho chủ sở hữu toàn quyền và mọi người khác quyền đọc và thực thi, dùng cho thư mục và script. 644 cho chủ sở hữu quyền đọc và ghi và mọi người khác chỉ đọc, dùng cho tệp thông thường.

777 nghĩa là gì và có an toàn không?

777 cấp quyền đọc, ghi và thực thi cho mọi người. Nó gần như luôn không an toàn trên máy chủ vì bất kỳ người dùng nào cũng có thể sửa tệp. Hãy ưu tiên 755 hoặc 644.

Làm sao để làm cho một tệp có thể thực thi?

Thêm bit thực thi. Từ 644 bạn sẽ chuyển sang 755 (hoặc chmod +x), bật thực thi cho chủ sở hữu, nhóm và những người khác.

Khác biệt giữa ký hiệu tượng trưng và bát phân là gì?

Bát phân (như 755) mã hóa quyền dưới dạng số, còn tượng trưng (rwxr-xr-x hoặc u+x) mô tả chúng bằng chữ cái. Công cụ này hiển thị cả hai và giữ chúng đồng bộ.

setuid, setgid và sticky bit là gì?

Chúng là một chữ số dẫn đầu thứ tư. Setuid và setgid chạy chương trình với tư cách chủ sở hữu hoặc nhóm của nó, và sticky bit trên một thư mục ngăn người dùng xóa tệp của nhau (như trên /tmp).

Tại sao bit thực thi hiển thị là s hoặc t?

Khi setuid, setgid hoặc sticky bit được đặt, vị trí thực thi hiển thị là s hoặc t thay vì x để báo hiệu bit đặc biệt đang hoạt động.

Nguồn

Nhúng công cụ này

Thêm công cụ này vào trang web của riêng bạn. Sao chép đoạn mã bên dưới; nó tự động cập nhật.

<iframe src="https://monu.tools/embed/vi/chmod-calculator" width="100%" height="640" style="border:1px solid #e5e5e5;border-radius:12px;max-width:680px" loading="lazy" title="Monu Tools"></iframe>

Công cụ liên quan