Chmod permissions (flags) explained: 600, 0600, 700, 777, 100 etc..

By neokrates, written on April 25, 2010

article

  • Join date: 11-30-99
  • Posts: 224
View Counter:
  • 87,658 views
Rate it
Ad
Poll
  • Your skill as shell programmer is?

    View Results

    Loading ... Loading ...
Feeds:
  • bodytext bodytext bodytext

Want to know what the numbers in chmod mean? Using flags is an easy and short form to set user permissions. This article puts it SIMPLE, if you want to learn the theory, also visit the links in the end.

There are four OCTAL (0..7) digits, which control the file permissions. But often, only three are used. If you use 600 it equals 0600. The missing digit is appended at the beginning of the number.

Each of three digits described permissions. Position in the number defines to which group permissions do apply!

Permissions:
1 – can execute
2 – can write
4 – can read

The octal number is the sum of those free permissions, i.e.
3 (1+2) – can execute and write
6 (2+4) – can write and read

Position of the digit in value:
1 – what owner can
2 – what users in the file group(class) can
3 – what users not in the file group(class) can

Examples:
chmod 600 file – owner can read and write
chmod 700 file – owner can read, write and execute
chmod 666 file – all can read and write
chmod 777 file – all can read, write and execute

Links:
1) Wikipedia explains that in greater detail: http://en.wikipedia.org/wiki/Filesystem_permissions
2) Main page for chmod: http://linux.die.net/man/1/chmod

Be Sociable, Share!
 


TAGS

SOCIAL
Be Sociable, Share!


20 Responses to “Chmod permissions (flags) explained: 600, 0600, 700, 777, 100 etc..”

  1. David Zhang says:

    This is a great post.  It’s just what I needed – something clean and simple, right to the point.
    I really appreciate your doing this!  Thanks!

  2. rasel says:

    wow i was searching them for a long time. you just answer me.

  3. […] my key I would have thought permissions would be set ok from the start but I anyway tried doing chmod 644 on the key […]

  4. Samuel says:

    Very clear and right to the point article. Thank you so much.

  5. Ben says:

    Short and sweet; thank you!

  6. Daniel says:

    Thank’s a lot neokrates, it solves my problem with file transferts
    Cheers,
     
    Daniel.

  7. […] permissions and ownership of /etc/firewall-openvpn-rules.sh. First we’ll change the mode to 700 (owner can read, write, and execute). Then, we’ll change the owner to root, in which […]

  8. […] the permissions and ownership of /etc/firewall-openvpn-rules.sh. First we’ll change the mode to 700 (owner can read, write, and execute). Then, we’ll change the owner to root, in which “root” […]

  9. […] des eigenen Web-Verzeichnisses an. Machen Sie davon gebrauch und versehen Sie Datei mit den Rechten 600. wp-config.php ein Verzeichnis über […]

  10. […] Here are some things about chmod. […]

  11. […] ????root????????????????????????Linux??????????3??????700??”???????????”? […]

  12. […] ????????700 (???????????)? […]

  13. […] tukarkan permission kepada file mac_accept tadi dengan menaip chmod 600 /etc/hostapd/mac_accept dan kemudian taip reboot untuk restart semula […]

  14. teranine says:

    Don’t forget 755 for rwxr-xr-x access to files and directories

  15. swamy says:

    nice post .it helped me to understand  about the mode_t than you very much neokrates

  16. […] then give it root privileges. If you remember from Part One, permissions in Linux are governed by different three-digit numbers. Seven hundred means “owner can read, write, and […]

Leave a Reply