ch 2 Flashcards

1
Q

/etc/passwd

A

stores the actual user account and maintains various settings related to accounts.

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

/etc/shadow

A

stores password information for the accounts. Only available to root user.

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

Why would some user use different shells?

A

If a user has more experience with another shell they might prefer to use that shell over bash (the most common shell).

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

/etc/profile

A

to set system-wide environment variables and startup programs for new user shells.

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

/etc/bashrc

A

to establish system-wide functions and aliases for new user shells.

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

/etc/skel

A

A sysadmin can store files in this directory and have those files automatically copy to the home directory of any new user.

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

useradd

A

The command that creates a user

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

usermod

A

The command that modifies existing users

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

userdel <user></user>

A

The command that deletes a user

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

useradd -c

A

set the comment value

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

syntax for useradd command

A

useradd -options argument (ex- useradd -c “Kai Garcia”)

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

passwd command

A

sets a password for a user (ex passwd [username])

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

adduser command

A

Some Linux distributions use the adduser command instead of useradd.
Some systems recognize both. The adduser command prompts administrators for details, including home directory locations and full names. Perhaps most importantly, adduser prompts sysadmins to set a user password. The adduser command can be added to a Linux system.

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

Why are user passwords stored in the /etc/shadow file and not the
/etc/passwd file?

A

The /etc/passwd file can be read by all processes and therefore isn’t as secure. The /etc/shadow file
can only be read by root.

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

What is the purpose of the /etc/skel directory?

A

Any files stored in this directory are automatically copied to the home directory of new user accounts. Profile files and other configurations can be easily set using /etc/skel.

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

Why might an administrator change a user’s default shell?

A

The user may be more comfortable with a different shell than Bash, such as the Zsh or Ksh.

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

/etc/group

A

shows existing group files and any users that are in groups.

18
Q

groupadd

A

create a new group

19
Q

groupmod

A

modify an existing group

20
Q

groupdel

A

remove an existing group

21
Q

groupmod -n

A

changes the name of the group

22
Q

how to add a user to a group

A

usermod -aG (without “a” the user will be removed from all other groups)

23
Q

Suggest at least two ways to display group membership information.

A

View the /etc/group file, id command, group command

24
Q

What command adds a user to a group?

A

The usermod command (usually with the -aG options).

25
Q

What is the result if an administrator forgets to add the -a option when
adding a user to a group?

A

The user is added to the specified group but removed from all other groups.

26
Q

Why might a user be a member of multiple groups?

A

Membership in multiple groups provides access to different resources. For example, a user who is a member
of both the sales group and the marketing group can be granted access to both types of resources.

27
Q

su

A

used for switching back and forth between users (usually root user and another lesser user to accomplish tasks. admin should really only do this)

28
Q

sudo

A

enables server admin to delegate specific commands to specific users

29
Q

/etc/sudoers

A

file to do delegation with visudo editor. do not edit file with vim or nano. it is sensitive.

30
Q

wheel group

A

allows members to use sudo command without having to sign in as the root user.

31
Q

A developer at your organization needs the ability to reboot a test
server, but their account’s standard privileges do not permit this. The
developer requests the system’s root user password in order to use su
to reboot the server. Is there a more secure option that aligns with the
principle of least privilege?

A

A better option is sudo, which allows the administrator to delegate only the necessary task (in this case,
rebooting the server). The root password combined with su would grant more than just the reboot privilege

32
Q

How are the su root and su - root commands different?

A

The su root command switches the user identity to that of root within the user profile settings of the original
user. The su - root command switches the user identity to that of root with the root user’s own profile
settings.

33
Q

You must delegate the shutdown -h privilege to SOMEUSER. What tool is
used to modify the /etc/sudoers file, and what line must be added to that
file?

A

The visudo command is run to edit the file. The following line is added to the file: SOMEUSER ALL=(ALL)
NOPASSWD: SHUTDOWN_CMDS

34
Q

Whose password must be entered with sudo? Whose password must be
entered with su?

A

The user’s own password must be entered with sudo. The destination user’s password must be entered
with su.

35
Q

sudo killall -u [username]

A

the command to kill or halt all processes for the user

36
Q

List at least three scenarios where you might need records of who logged
in to a Linux system.

A

security incident response, security audit, troubleshooting account access

37
Q

Another administrator asks you to explain the value of editing the /etc/
sudoer’s file with visudo rather than a traditional text editor. What is
your response?

A

The visudo editor confirms the syntax of the /etc/sudoers file. The file is very sensitive, and misconfiguration
could prevent administrative access to the system.

38
Q

List at least three reasons a user account might be locked.

A

An administrator locked the account while the user was on a leave of absence, an incorrect password was
entered too many times, and password settings are misconfigured.

39
Q

During a security audit it is discovered that a user does not have a
password set. When you check the /etc/passwd file, the password field is
properly populated with the x character. What file would actually display
whether a password has been set for the user?

A

/etc/shadow

40
Q

A user places sudo before a command, but the command still fails to run.
What might be the cause?

A

The /etc/sudoers file is not configured for the user or for the command.

41
Q

An administrator asks you how to delegate Linux administrative
privileges to a specific user. What group is used for such delegation?

A

the wheel group