Workbook 4 Flashcards

1
Q

In the output of a long listing (ls -l), which field indicates (i) the user owner and (ii) the group owner?

A

The second and third field. [4/4]

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

What are the three permission types for regular files and their symbols?

A

Read (R), Write (W), Execute (X). [4/5]

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

What does having the r permission for a regular file enable a user to do?

A

Read the contents of a file. [4/5]

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

What does having the w permission for a regular file enable a user to do?

A

Write changes to the file. [4/5]

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

What does having the x permission for a regular file enable a user to do?

A

Use the file as a command [4/5]

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

What are the three access classes and their symbols?

A

User Owner (U), Group Owner (G), and Other (O). [4/5]

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

If a file’s permissions are rwxr-xr-x, what are the permissions of each of the three access classes?

A

User Owner: Read, Write, and Execute.
Group Owner: Read and Execute.
Other Users: Read and Execute. [4/5]

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

When you try to access a file, what questions does Linux ask and in what order?

A
  1. Does the user own this file? ‘Owner’ permissions used.
  2. Is the user a member of the group that owns the file? ‘Group’ permissions used.
  3. ‘Other’ permissions used. [4/5]
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are the default permissions for regular files newly created by a normal user?

A

-rw-rw-r– [4/5]

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

To execute a file, what permission(s) does a user need for the file?

A

Executable permissions (X) [4/6]

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

What are the permissions always for a symbolic link?

A

Full permissions. rwxrwxrwx. [4/7]

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

Which user(s) can chmod a file?

A

The file owner, and root. [4/17]

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

Which user(s) can chown a file?

A

Only root. [4/17]

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

Which user(s) can chgrp a file?

A

The file owner, and root. [4/17]

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

How is the group owner determined for a newly created file?

A

By the current primary group for the user that created the file. [4/16]

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

What members comprise a user’s private group?

A

Only the user that it belongs to. [4/17]

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

Can the user owner of a file change the group ownership of that file to any group?

A

They can only change the group owner to a group they are currently a member of. [4/17]

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

Give the command line to change the group owner of notes.txt to group cisa

A

chgrp cisa notes.txt [4/17]

19
Q

Give the command line to change the user owner of notes.txt to user adam

A

chown adam notes.txt [4/17]

20
Q

What are the three permission types for directory files and their symbols?

A

Read (R), Write (W), Execute (X). [4/23]

21
Q

What does having the r permission for a directory allow a user to do?

A

List Directory Contents. [4/23]

22
Q

What does having the w permission for a directory allow a user to do?

A

Add or Remove files. [4/23]

23
Q

What does having the x permission for a directory allow a user to do?

A

Search for a known file in a directory. [4/23]

24
Q

Give the command line that outputs the permissions for the directory /etc

A

ls -ld /etc [4/23]

25
Q

What are the default permissions for directories newly created by a normal user?

A

Anyone and list the files, and search for them. But only the group owner and owner and add or remove files. drwxrwxr-x. [4/23]

26
Q

What are the default permissions for a user’s home directory in RHEL?

A

drwx——. Only the file owner has full permissions, group and other have none. [4/24]

27
Q

Generally, in only which two directories can a normal user create new files?

A

Their home directory (~) and tmp (/tmp). [4/24]

28
Q

When are files removed from /tmp?

A

Every 10 days. [4/24]

29
Q

In Linux, what are subdirectories named pub generally used for?

A

A folder that anybody can access. pub is short for Public.

30
Q

If you allow others access to your home directory, what should you do to protect your home directory’s subdirectories and why?

A

Remove permissions for ‘others’ in the folders within his home directory. [4/26]

31
Q

How are directories identified in a long listing?

A

Using the -d switch. [4/23]

32
Q

The Read (R) permission has what octal representation?

A
  1. [4/32]
33
Q

The Write (W) permission has what octal representation?

A
  1. [4/32]
34
Q

The Execute (X) permissions has what octal representation?

A
  1. [4/32]
35
Q

The octal permissions of 755 would translate to what in symbol permissions?

A

-rwx-r-x-r-x

7 = 4 + 2 + 1 = rwx for (u)ser
5 = 4 + 0 + 1 = r-x for (g)roup
5 = 4 + 0 + 1 = r-x for (o)ther [4/32]
36
Q

The octal permissions of 640 would translate to what in symbol permissions?

A

-rw-r—–

6 = 4 + 2 + 0 = rw- for (u)ser
4 = 4 + 0 + 0 = r-- for (g)roup
0 = 0 + 0 + 0 = --- for (o)ther [4/33]
37
Q

The octal permissions of 701 would translate to what in symbol permissions?

A

-rwx—–x

7 = 4 + 2 + 1 = rwx for (u)ser
0 = 0 + 0 + 0 = --- for (g)roup
1 = 0 + 0 + 1 = --x for (o)ther [4/33]
38
Q

What is the kernel’s global default for regular files?

A

666 -rw-rw-rw- [4/38]

39
Q

What is the kernel’s global default for directories?

A

777 drwxrwxrwx [4/38]

40
Q

What is the default mode of newly created (i) regular files and (ii) directories?

A

Global Default Mode [4/38]

41
Q

Give the command line to view your current umask value.

A

umask [4/39]

42
Q

Give the command line to change the umask value to 044

A

umask 044 [4/39]

43
Q

You want a different umask than the bash shell’s default. Which file do you modify to automatically change the bash shell’s umask every time you log in?

A

~/.bashrc [4/40]