2. File Basics tinguish between (Web server iis) three user categories:

2. File Basics tinguish between three user categories: the owner of the file, every user who is a member of the group associated with the file (also called the owner group) but who is not the owner, and others, which includes every other user who is neither the owner nor a member of the owner group. There are three different permissions: 1. Read permission (r): enables a user to read the contents of a file. For a directory, the user can list its contents (i.e. the files in this directory). 2. Write permission (w): allows modification of a file’s content. For a directory, the write permission allows a user to add or remove files from this directory, even if he is not the owner of these files. 3. eXecute permission (x): enables a file to be executed (normally only executable files have this permission set). For a directory, it allows a user to traverse it, which means going into or through that directory. Note that this is different to the read access: you may be able to traverse a directory but still be unable to read its content! Every permission combination is possible. For example, you can allow only yourself to read the file and forbid access to all other users. As the file owner, you can also change the owner group (if and only if you’re a member of the new group). Lets take the example of a file and a directory. The display below represents entering the ls -l command from the command line: $ ls -l total 1 -rw-r—–1 queen users 0 Jul 8 14:11 a_file drwxr-xr–2 peter users 1024 Jul 8 14:11 a_directory/ $ The results of the ls -l command are (from left to right): The first ten characters represent the file’s type and the permissions associated with it. The first character is the file’s type: if it’s a regular file, you will see a dash (-). If it’s a directory, the leftmost character will be a d. There are other file types, which we’ll discuss later on. The next nine characters represent permissions associated with that file. The nine characters are actually three groups of three permissions. The first group represents the rights associated with the file owner; the next three apply to all users belonging to the owner group; and the last three apply to others. A dash (-) means that the permission is not set.

Leave a Reply