ch3. Users And Groups Flashcards

1
Q

usermod
usermod -l
usermod -c

A

Bash command to change a user account
-l change username
-c change comment field

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

passwd -l
passwd -u

A

Bash command
-l lock an account
-u unlock an account

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

userdel
userdel -r

A

Bash command to delete a user account. Without options, does not delete the home directory, or saved files.
-r deletes the account including the home directory and saved files

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

/etc/group

A

stores all group information

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

group fields

A

Group Name : Password : Group ID : Group List (list of members)

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

groupadd
groupadd -g
.
groupadd -f
groupadd -o
groupadd -g
groupadd -n

A

Bash command to create a group (by default, no password, no members)
-g create group with name or ID
.
-f exit command with a success status if the group already exists
-o create a group with a non-unique group ID
-g change the ID of an existing group
-n change the name of an existing group

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

groupdel

A

Bash command to delete a group, but does not delete members of the group

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

usermod -a -G

A

Bash command to add a user to a group

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

whoami

A

Bash command to display current username of currently logged-in account

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

who
who -u

A

Bash command to print the details of of a user currently logged into a system, including: username, system name, and length of connection
-u prints user and idle time

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

standard user prompt

A

$

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

root user prompt

A

#

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

w (command)

A

Bash command to print the status of the system + users logged in, + current activities of users

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

last

A

Bash command to print information about connect times of users
useful for finding what commands were recently run

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

Where does ‘last’ retrieve info from?

A

/var/log/wtmp

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

.bashrc

A

file that allows customization of user’s own environment. In particular, enables command line alias that will only affect the .bashrc file’s user. Also creates an environment variable, set default directories, and file permissions for the default user. Also determines the default command prompt.

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

.bash_profile

A

shell config for initial login environment. (only used for very first login.) Think of as a default config for new users.

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

file to be edited to allocate system rights to other users on the system?

A

/etc/sudoers

19
Q

file would be modified when using the useradd, usermod, or userdel commands

A

/etc/passwd

20
Q

which file contains the hashed version of each user’s password?

A

/etc/shadow

21
Q

when a new user is created, what file is copied into the new users home directory, and can be used to configure new user’s default directory?

A

/etc/skel

22
Q

/etc/profile

A

system wide account settings for all users, not just new users. Is read before Bash configs, so any individual customizations take priority over what is established here

23
Q

/etc/profile.d

A

location for scripts that admin use for system-wide variables

24
Q

/etc/bashrc (repeat?)

A

system wide settings for the command line environment

25
Q

user accounts are referenced by:

A

UID or User ID

26
Q

the root account is used for:

A

for admin tasks, and to security guard applications/commands

27
Q

Principal of Least Privilege

A

to grant minimal access to a system while still meeting the needs of the user

28
Q

Service Account

A

an account disabled from a user logging into, used to grant permissions to services and applications

29
Q

When to log into root

A

never

30
Q

sudoedit

A

Bash command to allow a user to edit a file even if the file is only available to root and allows use of any file editor

31
Q

%editors ALL = sudoedit path/to/file

A

example of a group file edit that allows all users in the editor’s group to edit /path/to/file with sudoedit

32
Q

visudo
visudo -c
.
visudo -f
visudo -s
visudo -x

A

Bash command to edit the /etc/sudoers file in a safe manner by verifying the syntax of proposed edits before committing them.
-c check the file for errors
.
-f check/edit the file location
-s check file in strict mode
-x output the file in a json file format

33
Q

Wheel Group

A

Allows member users access to the sudo command

34
Q

id

A

prints the username of the currently logged in account

35
Q

useradd

A

creates a new user in /etc/passwd

36
Q

/etc/login.defs

A

file that configures new user accounts

37
Q

/home/username

A

location of a user’s home directory

38
Q

what does useradd not do?

A

It does not create a password for the new user account, and until one is created, the account cannot be signed into

39
Q

useradd -c
useradd -e
useradd -s
useradd -D

A

-c sets comment field of account (usually the full name of the user)
-e sets the expiration date
-s sets the default shell for the user
-D prints the default config for a new user

40
Q

passwd

A

Bash command to set or reset the password for a user account. Any user can use it to reset their own account.

41
Q

/etc/passwd

A

file that stores the: username, user id, group id, comment, home directory, and login shell for all users. It stored the passwords as well in legacy systems.

42
Q

‘sudo !!’ (command)

A

Bash command that executes the previously entered command as root

43
Q

/etc/shadow

A

file that stores: username, password (in a hashed format), and various values relating to password change and warnings

44
Q

chage
chage -E

chage -M
chage -W

A

command stands for ‘change age’
-E change the expiration date for a user account

-M change the number of days until a user needs to change their password
-W change the days ahead warning that a password needs to be changed