Let's examine the output from the ls l command. For example, type the following: >ls -l -rw-r--r-- 1 rob rob 2024 Dec 25 20:22 39 atest.tar -rwxrwxr-x 5 rob rob 1024 Dec 25 20:22 atest2.tar ... When considering file and directories, you have to understand the concept of ownership. Ownership is nothing more than noting who owns the file. Each file has information stored with it that identifies the account that owns it. From the example of ls l, you can see that I am the owner of the two files in my current directory: atest.tar and atest2.tar. Files are owned by those who create them, although ownership can be transferred. Each file on the Unix system also has a secondary piece of information stored that records the group ownership of the file.
Permissions, once applied, will control what a user (or group) can do to a file or directory. There are three basic actions, which are self-explanatory: read, write, and execute. We have already spent time covering what executables are earlier in the book. If you do not have the permissions such as read, write, or execute, then you will not be able to work with the files. It's really that simple.
Directory Permissions SpecificsWe just covered files, but what about the directories that hold the files? Permission rights for directories are slightly different than those of files. If a directory has execute permissions turned off, you cannot change into that directory (using the cd command), view its contents, or write to it. It is effectively turned off. If read permissions are turned off, you can still create files in the directory and read them, but you cannot get a listing of what is in the directory. Lastly, if the write permission for a directory is turned off, you can view a listing of the contents and read files, but you cannot create any new files. Permission LevelsWhen permissions are applied to a file or directory, they are applied at three specific levels: owner, group, and world.
If there is guest access to your computer, you can assume that any active other permissions apply to anyone who can access your computer. |