Your first step in changing ownership and permissions is to find out who owns which files. You'll need this information to find out whether you can make changes to the permissions.
To find out who owns what:
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). The left column contains nine characters that specify permissions for each file: 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. | |
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.
|
Tip
Sometimes you'll see references to world-readable or world permissions. This is the same as other. "Other" just refers to not you, not the group, but anyone else.
Tip
Note that the ftp directory line shown in Code Listing 5.1 is a little unusual. It's a link, as discussed in Chapter 2.
[ejr@hobbes permissions]$ ls -l total 152 -rw-rw-r-- 1 ejr ejr 128889 Jul 24 14:33 sage.sayings -rw-rw-r-- 1 ejr ejr 23890 Jul 24 14:33 sayings [ejr@hobbes permissions]$ |
[ejr@hobbes permissions]$ grep ejr /etc/passwd ejr:aag2.UyC7yJWE:500:500:Eric J. Ray:/home/ejr:/bin/bash [ejr@hobbes permissions]$ |
[ejr@hobbes permissions]$ cat /etc/group kmem::9: wheel::10:root,ejr mail::12:mail news::13:news uucp::14:uucp man::15: games::20: gopher::30: dip::40: ftp::50: nobody::99: users::100:ejr,deb,asr,awr floppy:x:19: pppusers:x:230: popusers:x:231: slipusers:x:232: postgres:x:233: ejr:x:500: bash:x:501: csh:x:502: asr:x:503: awr:x:504: deb:x:505: [ejr@hobbes permissions]$ |
3.134.78.106