Directory Ownerships and Permissions Flashcards

1
Q

Because directories are also files, they have a…?

A

user owner, a group owner, and a set of permissions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Read permissions allow a user to…?

A

list the contents of a directory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Write permissions allow a user to…?

A

access a file within the directory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Execute permissions allow a user to …?

A

access a file within the directory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Directory permissions are…?

A

modified with chmod command.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

When someone is using a file within Linux, they are generally either…?

A

reading its information, modifying its information, or trying to execute the file as a script or application. (Therefore the permission types are already discussed, namely (r)ead, (w)rite, and e(x)ecute have a very natural interpretations).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

To Linux, a directory is just a special type of file, therefore it also has the same types of….?

A

permissions ((r)ead, (w)rite, and e(x)ecute), a user owner, a group owner, and the same classes of access ((u)ser, (g)roup, and (o)ther. However, directories are obviously used differently.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Would it be meaningful to open a directory in an editor, such as nano/home/elvis?

A

Because people use directories differently, directory permissions have different interpretations.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What do people do with directories…?

A

They list their contents with the ls command. They remove files from them, create new files within them, and move files from one directory to another.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Directory permissions should allow a directory owner to control…?

A

who can perform which of these operations.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Linux considers listing a directory’s contents (as with the ls command) analogous to..?

A

“read”ing a directory, and therefore someone must have (r)ead permissions to list its contents.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Adding or removing a file from a directory is considered…?

A

“write”ing to the directory, and therefore someone must have (w)rite permissions in order to shuffle files within the directory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

There is no reasonable analogy to “execute”ing a directory, so Linux doesn’t try to define a similar behavior. Instead, the e(x)cute permission controls…?

A

a behavior for directories which has nothing to do with the command execution. In order to access any file within a directory, a user must have e(x)cute permission. This permission is known as the “search” permission, but the third permission was already called “execute” for regular files. the same word (and letter) is used for directories as well. In order to refer to any file within a directory (including subdirectories!), a user must have e(x)ecute permissions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What (r)ead, (w)rite and e(x)ecute permissions mean to a regular file..?

A

(r)ead = view the file
(w)rite = modify the file
e(x)ecute = use the file as a command

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What (r)ead, (w)rite, e(x)ecute permissions mean to a directory…?

A

(r)ead = list directory contents
(w)rite = add or remove files
e(x)ecute = “search” for a known file within the directory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Newly created regular files are …?

A

readable by everybody, but can only be modified by the user and group owner of the file.

17
Q

How are newly created directories handled…?

A

The default permissions for newly created directories are rwxrwxr-x. These permissions have the following implications:

  1. Anyone can search files within the directory.
  2. Anyone can list the files within the directory.
  3. Only the directory owner (or members of the group owner) can add or remove files from within the directory.
18
Q

In Red Hat Enterprise Linux, a user’s home directory does not…?

A

fallow the default permissions.

19
Q

In Red Hat Enterprise Linux, home directories are…?

A

“protected”. By default, the only the user that owns a home directory has search permissions.

20
Q

In Red Hat Enterprise Linux, there are generally only two places where users can create files…?

A

the /tmp directory and ~ (the user’s home directory.)

21
Q

In Red Hat Enterprise Linux, the /tmp directory is “swept.” If a file within the /tmp is not accessed for 10 days, it is…?

A

removed from the system.

22
Q

”.” always refers to the…?

A

current directory, in this case /home/nero/pub.

23
Q

”..” always refers to…?

A

the current directory’s parents, in this case /home/nero.

24
Q

In order to create a publicly accessible directory within a home directory, a user must…?

A

allow people to search their home directory.

25
Q

Often, users elect to allow other users to have access to their home directories (consider, for example, the previous example). By allowing others e(x)ecute, but not (r)ead, permissions to their home directory, other users…?

A

must know that a directory exists within the home directory in order to access it. Because other users may not use the ls command to discover the contents of their home directory, users home directories remain private, and only the parts they choose to expose are available to other users.

26
Q

While not adding (r)ead permissions to a home directory provides some protection against the browsing of the other users, it is not…?

A

foolproof. Other users can still “guess” all the contents of a directory to which they have e(x)ecute but not (r)ead permissions. For example, users commonly create a directory called ~/mail, for storing mail messages.