Users Flashcards

1
Q

Three types of accounts

A

root, standard user and service

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

command to edit the /etc/sudoers file, verifies for errors before commiting changes

A

visudo

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

check existing sudoers file for errors

A

visudo -c

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

check a sudoers file in a different location than the default

A

visudo -f {file location} -c

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

check sudoers file in strict mode, any aliases that are used before being defined will result in errors

A

visudo -s

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

output the sudoers file to a specified file in JSON format

A

visudo -x {filename}

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

command to create user accounts and configure basic settings (does not create a password)

A

useradd [options] [user name]

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

location where account is stored

A

/etc/passwd

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

a new account is configured according to options in this file

A

/etc/login.defs

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

Account home directory is populated with files from this directory

A

/etc/skel

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

useradd option for comment (usually used as field for user’s name)

A

-c

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

useradd option for expiration date

A

-e

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

useradd option set default shell

A

-s

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

useradd option view default config for new users

A

-D

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

command used to create a password for a new user created with useradd command

A

passwd

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

file that stores user account information

A

/etc/passwd

17
Q

file owned by root that stores hashed password

A

/etc/shadow

18
Q

command used to control password expiration, expiration warnings, inactive days and other info for existing accounts

A

chage [options] {user name}

change age

19
Q

Set account to expire at specific date and time

A

chage -E 2022/12/31 brian

20
Q

option to list password aging information

A

chage -l brian

21
Q

option to set max days the password is valid

A

chage -M 90 brian

22
Q

option to set min number of days until password can be changed

A

chage -m 1 brian

23
Q

sets number of days before expiration that user will be warned to change their password

A

chage -W 5 brian

24
Q

command used to modify settings for regular users (edits the /etc/passwd file)

A

usermod [options] {username}

25
Q

modify comment field of user

A

usermod -c “User One” user1

26
Q

modify account expiration date

A

usermod -e 2020/12/31 user1

27
Q

add user to a group and keeps them in their existing groups

A

usermod -aG sales-group user1

28
Q

modify a user’s login name

A

usermod -l user99 user1

29
Q

two commands to lock a users account

A

passwd -l {user name}

usermod -L {user name}

30
Q

two commands to unlock a users account

A

passwd -u {username}

usermod -U {user name}

31
Q

command used to delete user accounts

A

userdel [options] {user names}

32
Q

command to delete an account and remove the users home directory

A

userdel -r brian