Your first step in changing ownership and permissions is to find out who owns which files. You’ll need this information to find out if you can make changes to the permissions.
1. | cd At the shell prompt, type cd to return to your home directory. | ||
2. | ls -l Enter ls -l to see the long listing of the files in the current directory. (See Code Listing 5.1.) Code Listing 5.1. Many systems use only a few group names to allow easy file sharing and collaboration.
On this system, files that individual users create are associated with the user’s group, while files destined for the Web have www group associations. On other systems, the default group for files might be a group with the same name as the userid, as shown in Code Listing 5.2. Code Listing 5.2. Sometimes the group name and user name are the same, depending on how the system was set up.
| ||
3. | ls -l /etc You can also use the ls -l command on a system directory, such as /etc. Here, you’ll see that most of the files are owned by root, possibly with a variety of different group memberships (see Figure 5.1). Figure 5.1. Most of the files in /etc are owned by root. |
✓ Tips
Sometimes you’ll see references to world-readable or world permissions. This is the same as other. “Other” just refers to anyone who is not you or not in the group.
You might also hear of s or SetUID permissions, which indicate that the program or file can run with the effective userid of the file’s owner (usually root). For example, /usr/bin/passwd has s permissions because you can run passwd to change your password, but the command needs to run as root to actually modify the password database.
You might also see a t at the end of the list of permissions, which indicates that the sticky bit is set. Setting the “sticky bit” means primarily that, in a shared directory, you can delete only your own files (and not accidentally delete files belonging to others).