Before moving on to the chmod command, which allows you to change the permissions associated with a file or directory, let's review how Linux understands those permissions. Note Linux systems are beginning to use a more granular and powerful permission system known as Access Control Lists (ACLs). At this time, however, ACLs are still not widely used, so they're not covered here. For more info about ACLs, see "Access Control Lists" at Linux Magazine (www.linux-mag.com/2004-11/guru_01.html) and "An ACL GUI for Linux" at The Open Source Weblog (http://opensource.weblogsinc.com/2005/12/06/an-acl-gui-for-linux/). Linux understands that three sets of users can work with a file or directory: the actual owner (also known as the file's user), a group, and everyone else on the system. Each of these sets is represented by a different letter, as shown in Table 7.1.
In the "List Permissions, Ownership, and More" section in Chapter 2, "The Basics," you learned about long permissions, which indicate what users can do with files and directories. In that section, you looked at three attributes: read, write, and execute, represented by r, w, and x, respectively. Additional possibilities are suid, sgid, and the sticky bit, represented by s (or S on some systems), s (or S), and t (or T). Keep in mind, however, that all of these can have different meanings depending on whether the item with the attribute is a file or a directory. Table 7.2 summarizes each attribute, its abbreviation, and what it means.
Note The root user can always do anything to any file or directory, so the previous table doesn't apply to root. Each of these file attributes is covered in more detail in the following sections. Now that you understand the basics, let's look at using the chmod command to change the permissions of files and directories. |