2.2 Given a scenario, implement identity management Flashcards

1
Q

Define bashrc file and 2 locations/uses

A

configuration (script) file that defines functions and aliases used by all shell sessions and users
1. /etc/bashrc - for all system users
2. ~ - user specific copies can be placed in user home directories

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

Define /etc/profile file

A

system-wide shell config file for login (text-based) shell

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

Define .bash_profile file

A

user specific shell config file for login (text-based) shell

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

Define function of the /etc/passwd file

A

Contains all the user accounts, both standard and system accounts, for the system
does not contain passwords, although there is a legacy placeholder for it

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

Define the 7 fields in the /etc/passwd file

A
  1. Username
  2. Password (not used)
  3. UserID #
  4. Primary Group ID # (GID)
  5. Description field, usually used for the user’s full name
  6. Path to home directory
  7. Path to default shell
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Define function of the /etc/shadow file

A

Holds passwords and password info, must have an entry corresponding to each user/system account in the /etc/passwd file

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

What are the 2 security benefits of the /etc/shadow file?

A
  1. Separates the passwords from being in the same physical file as the other user info
  2. Stores passwords in encrypted form
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the 8 fields in the /etc/shadow file?

A
  1. Username
  2. Password
  3. Days since password was changed
  4. Minimum password age in days
  5. Maximum password age in days
  6. Password change warning in days
  7. Days after password expires to disable account
  8. Disable time - days after which the account will be disabled
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What 3 symbols might appear in the password field of /etc/shadow?

A
  1. $ - indicates that the text following is encrypted
  2. ! or !! - indicates that the account is locked and cannot be used to login
      • indicates that the account is a system account and cannot be used to login
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Which 2 fields in the /etc/shadow file represent the date as the number of days since Jan 1, 1970?

A

Last change & disable time

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

What values are typically used when user id #’s are assigned to standard user accounts and system user accounts

A

Standard user accounts either use id’s starting at 1000, or 500 on some systems, values less than this are reserved for assignment to system user accounts

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

Define primary user group (3)

A
  1. Created by default upon creation of a user account
  2. The corresponding user is the only member of the group
  3. Is automatically assigned as the owner of files/directories created by the user
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Define function of the /etc/group file

A

Contains all the groups defined on the system

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

What are the 4 fields in the /etc/group file

A
  1. Group name
  2. Group password (not used - stored in /etc/gshadow if defined)
  3. Group ID
  4. Group members - comma separated list of usernames
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Define secondary user group (2)

A
  1. Used to manage access to file/directories
  2. Users are added manually by an admin
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Define what /etc/skel is used for

A

contains directories & files that are automatically copied to a new user’s home directory when a new user is added

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

Command: passwd

A

assigns or changes the password for a user, users can update their own password, root access required to modify other passwords
Syntax: passwd [username]

18
Q

How do you display the status of a user account?

A

passwd -S [username]

19
Q

What characters indicate if a user account is locked or not?

A

LK indicates locked, PS indicates password set not locked

20
Q

What is the command to lock/disable a user account?

A

passwd -l [username]

21
Q

What is the command to unlock a locked user account?

A

passwd -u [username]

22
Q

What file can be viewed to see if a user account is locked or not?

A

/etc/shadow, the password for a locked account is preceded with “!!”

23
Q

What command removes the password from a user account?

A

passwd -d [username]

24
Q

What switch for the passwd command sets the minimum number of days before password can be changed?

A

-n

25
Q

What switch for the passwd command sets the expiration date for the password

A

-x

26
Q

What switch for the passwd command sets the number of days before password expires for warning?

A

-w

27
Q

What switch for the passwd command sets the number of days following the password expiration that the account will be disabled?

A

-i

28
Q

Command: useradd

A

adds a user
Syntax: useradd [options] [username]

29
Q

What switch for the useradd command adds text, such as full name, to the “Comments” field?

A

-c

30
Q

What switch for the useradd command sets the users home directory path?

A

-d

31
Q

What switch for the useradd command creates the home directory if it does not exist?

A

-m

32
Q

What switch for the useradd command does not create the home directory?

A

-M

33
Q

What switch for the useradd command sets the default shell?

A

-s

34
Q

What switch for the useradd command sets the password (value entered should be pre-encrypted)?

A

-p

35
Q

What command displays the default values specified in the /etc/default/useradd file?

A

useradd -D

36
Q

What switch for the useradd command sets the primary group membership?

A

-g

37
Q

What switch for the useradd command sets the secondary group(s) membership?

A

-G

38
Q

Define command: userdel

A

removes a user, default leaves home directory intact
Syntax: userdel [options] [username]

39
Q

What switch for userdel also removes the user’s home directory?

A

-r

40
Q

What switch for userdel forces removal of a user that is logged in to the system?

A

-f

41
Q

Define command: usermod

A

modifies an existing user account
Syntax: usermod [options] [username]

42
Q

How can a user’s username be updated and home directory moved to updated username directory?

A

usermod -l [new username] -d [new home directory path] [username]