Results 1 to 4 of 4

Thread: CHMOD ???

  1. #1
    BingLi224
    Guest


    CHMOD ???

    CHMOD คืออะไรครับ ทำงานยังไงครับ

  2. #2
    Junior Member
    Join Date
    Oct 2002
    Location
    Thailand
    Posts
    0


    Re: CHMOD ???

    เป็นคำสั่งที่เอาไว้ set permission องไฟล์และโฟลเดอร์ใน Unix, Linux system ครับ

    ลองพิมพ์ ls -l จะลิสต์รายละเอียดของไฟล์และโฟลเดอร์ โดยที่แต่ละอันก็จะมีตัวอักษรอยู่ 10 ตัวประมาณนี้

    -rwxrwxrwx

    ตัวอักษรตัวแรกจะบ่งบอกสถานะว่าเป็นไฟล์หรือโฟลเดอร์ (-คือไฟล์, dคือโฟลเดอร์)
    ตัวอักษรสามตัวถัดมาบอกว่าเจ้าของไฟลฺทำอะไรกับมันได้บ้าง (r=read, w=write, x=execute)
    ตัวอักษรสามตัวถัดมาบอกว่า userในกลุ่มเดียวกับเจ้าของทำอะไรกับมันได้บ้าง
    ตัวอกษรสามตัวสุดท้ายบอกว่าคนอื่นๆ (other) ทำอะไรกับมันได้บ้าง

    ในตัวอย่างหมายความว่า
    - เป็นไฟล์
    - เจ้าของสามารถ list ไฟล์, save ไฟล์ หรือสั่งรัน
    - คนในกลุ่มก็ทำได้ทุกอย่าง
    - คนอื่นก็ทำได้ทุกอย่าง

    วิธีใช้อย่างละเอียดลองพิมพ์ man chmod ดูนะ

  3. #3
    BingLi224
    Guest


    Re: CHMOD ???

    แล้วที่เป็นตัวเลขล่ะครับ เป็น binary representation เหรอครับ

  4. #4
    Junior Member
    Join Date
    Oct 2002
    Location
    Thailand
    Posts
    0


    Re: CHMOD ???

    Quite right, this is the way it works

    1 = execute
    2 = write
    4 = read

    note that the total is 7
    execute and read are: 1+4=5
    read and write are: 2+4=6
    read, write and exec: 1+2+4=7
    and so on

    directories must always be executable...

    then remember that there are also three in the order, as in 750 or 644:
    the first one is owner,
    the second one is group
    and the last is everyone else on the system(world)

    so a file with, say 640, means, the owner can read and write (4+2=6), the group can read (4) and everyone else has no permission to use the file (0).

    now consider, say 770, both the owner and the group can read write and execute, but no one can do anything else

Similar Threads

  1. Website Protection and Security Using File and Directory CHMOD
    By newsbot in forum World Hacking/Security News
    Replies: 0
    Last Post: 27-10-2009, 11:35 AM
  2. รู้จัก CHMOD กันรึยัง
    By del2007 in forum ข่าวสารด้าน IT ใหม่ๆ
    Replies: 0
    Last Post: 02-10-2007, 12:17 PM

Members who have read this thread : 0

Actions : (View-Readers)

There are no names to display.

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •