Linux - Copied from midterm review (answers) Flashcards

(41 cards)

1
Q

For hardening purposes, what is the primary benefit of having the file /etc/shadow?

A

It stores encrypted user passwords, making them unreadable directly.

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

Which of the following represents the symbolic permission to give the owner read and write access, the group only read access, and others no access?

A

u=rw,g=r,o=-

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

If a Linux file has the permissions -rw-r–r–, who has the ability to write to the file?

A

Only the owner

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

Which of the following files contains encrypted passwords of users?

A

/etc/shadow

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

Setting the ‘s’ bit on a file in the user ownership does which of the following:

A

All processes created using that file run with the user ownership of the command file

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

To be able to change into directory Dir1, what is the minimum permissions necessary for the Dir1 directory?

A

Execute (x)

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

What is the octal permission of a directory that allows the owner to access files if they know their names, but not to list or to change the file names?

A

100

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

Setting the ‘s’ bit on a directory in the group ownership does which of the following:

A

All files created in that directory will have the same group ownership as the parent directory

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

The UID and GID for a user can be found in which file?

A

/etc/passwd

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

The /etc/group file contains information about:

A

Group memberships

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

For system hardening purposes, how can an administrator restrict a specific user from using the sudo command to gain superuser privileges?

A

Explicitly deny the user in the /etc/sudoers file or associated configurations.

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

In the context of Linux access controls, what does DAC stand for?

A

Discretionary Access Control

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

Setting the ‘s’ bit on a file in the group ownership does which of the following:

A

All processes created using that file run with the group ownership of the command file

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

In an empty directory, you run the commands: touch ??? * ; chmod 111 * chmod 444 ??? ; chmod 666 ‘*’ ; chmod 333 * What permissions are on file ??? after above commands?

A

-wx -wx -wx

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

What is the octal mode of a directory that allows only the user to cd into it and list the names in it and create any new files?

A

700

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

Which command is used to change the ownership of a file in Linux?

A

chown

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

Which of the following commands is used to show the user’s own identity and group information?

18
Q

Which of the following commands can be used to change the ownership of a file in Linux?

19
Q

Which file in Linux contains the encrypted passwords of users?

20
Q

Which command is used to modify an existing user’s information in Linux?

21
Q

Which of the following commands is used to change a user’s default login shell?

22
Q

In the file /etc/group, what does the last field represent?

A

List of users

23
Q

What is the easiest way for root to allow a regular user in Red Hat Enterprise Linux to run any administrator commands with sudo?

A

Add the user to the wheel group

24
Q

What value of umask gives the permissions below to a new file: rw-rw-r–

25
You are working at the Linux command line and your username is “homer”. You execute the command ls and see the following output: -rw-rw-r-- 1 homer homer 387 Nov 28 08:26 bigfoot -rwxr-xr-x 1 homer homer 1851882 Nov 28 08:26 dragon -rwxrwxr-x 1 homer homer 15957213 Nov 28 08:26 kraken What command can you type which will remove execute permission from the file dragon for all users except yourself?
chmod 744 dragon
26
Refer to the exhibit above. What would be the permissions of f1.txt after executing the last command?
700
27
When hardening a server system, which account should have its direct login access blocked?
Root user
28
In a Linux system, which account type is created for running specific services or applications?
System users
29
If an administrator wants to efficiently manage multiple users' default settings upon creation, which directory plays a critical role?
/etc/skel
30
What Linux command can be used to set the default permissions for all newly created files?
umask
31
Which command allows you to view the groups a user belongs to?
id
32
If an administrator wishes to prevent a specific user from using the sudo command, they should edit which file?
/etc/sudoers
33
What command is used to create a new group?
groupadd
34
To ensure a user cannot directly log into the system, which shell should be assigned in /etc/passwd?
/bin/nologin
35
In a multi-user GNU/Linux environment, which command is the safest to use when changing a user's default shell?
chsh
36
What Linux command can be used to change the group of a file?
chgrp
37
You are working at the Linux command line. What command can you type which will result in a new file being given the following permissions by default: - The file owner can read and write to the file, but not execute it. - Everyone other than the owner can read the file, but not write to or execute it.
umask 133
38
The filename /etc/passwd is a(n) _________________.
Absolute path
39
Which of the following is not true of the root user?
The root user can access any computer on the network.
40
Which Access Control Technique is based on security labels and is mandatory regardless of the user's wishes?
MAC
41