Monu Tools

คำนวณ chmod

แปลงสิทธิ์ไฟล์ Unix ระหว่างช่องทำเครื่องหมาย ออกทัล (เช่น 755) และสัญลักษณ์ (เช่น rwxr-xr-x)

วิธีใช้ chmod Calculator

  1. 01

    ทำเครื่องหมายช่องอ่าน เขียน และดำเนินการสำหรับเจ้าของ กลุ่ม และอื่นๆ

  2. 02

    หรือพิมพ์ค่าออกทัลเช่น 755 เพื่อตั้งช่องโดยอัตโนมัติ

  3. 03

    คัดลอกคำสั่ง chmod ที่พร้อมใช้งาน

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.

คำถามที่พบบ่อย

755 และ 644 หมายความว่าอะไร?

755 ให้เจ้าของเข้าถึงได้เต็มและทุกคนสามารถอ่านและดำเนินการได้ ใช้สำหรับไดเรกทอรีและสคริปต์ 644 ให้เจ้าของอ่านและเขียนได้และทุกคนอ่านได้เท่านั้น ใช้สำหรับไฟล์ปกติ

777 หมายความว่าอะไรและปลอดภัยไหม?

777 ให้สิทธิ์อ่าน เขียน และดำเนินการแก่ทุกคน แทบจะไม่ปลอดภัยบนเซิร์ฟเวอร์เสมอเพราะผู้ใช้ใดก็สามารถแก้ไขไฟล์ได้ ควรใช้ 755 หรือ 644 แทน

ทำให้ไฟล์สามารถดำเนินการได้อย่างไร?

เพิ่ม execute bit จาก 644 คุณจะย้ายไปที่ 755 (หรือ chmod +x) ซึ่งเปิด execute สำหรับเจ้าของ กลุ่ม และอื่นๆ

ความแตกต่างระหว่างสัญลักษณ์และออกทัลคืออะไร?

ออกทัล (เช่น 755) เข้ารหัสสิทธิ์เป็นตัวเลข ขณะที่สัญลักษณ์ (rwxr-xr-x หรือ u+x) อธิบายเป็นตัวอักษร เครื่องมือนี้แสดงทั้งสองและซิงค์กัน

setuid, setgid และ sticky bit คืออะไร?

เป็นหลักนำที่สี่ Setuid และ setgid รันโปรแกรมในฐานะเจ้าของหรือกลุ่ม และ sticky bit บนไดเรกทอรีป้องกันผู้ใช้ลบไฟล์ของกันและกัน (เช่นบน /tmp)

ทำไม execute bit แสดงเป็น s หรือ t?

เมื่อตั้ง setuid, setgid หรือ sticky bit ตำแหน่ง execute จะแสดงเป็น s หรือ t แทน x เพื่อส่งสัญญาณว่า special bit ทำงานอยู่

แหล่งข้อมูล

ฝังเครื่องมือนี้

เพิ่มเครื่องมือนี้ลงในเว็บไซต์ของคุณเอง คัดลอกสคริปต์ด้านล่าง โดยจะอัปเดตให้เป็นปัจจุบันโดยอัตโนมัติ

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

เครื่องมือที่เกี่ยวข้อง