Users Flashcards

1
Q

What is the command to view who is logged in to the system?

A

who

w *detailed

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

What is the command to get the user and group ID of a user?

A

id

id >user

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

Where is user account information stored?

A

/etc/passwd

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

Where are hashed user passwords stored?

A

/etc/shadow

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

Where a group memberships stored?

A

/etc/group

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

What is the format for a user account in /etc/passwd?

A

user: pw:userid:groupid:comment:homedirectory:loginshell
i. e user:x:1002:1003::/home/cloud_user:/bin/bash
* services do not have a home or login shell

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

Which group membership denotes a user having root priveleges?

A

wheel

*has group id of 10

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

What is the command to change a user password?

A

passwd >user

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

What is the format output for the id command?

A

uid gid groups

i.e uid=1002(user) gid=1003(user) groups=1003(cloud_user),10(wheel)

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

What is the format for a group in /etc/group

A

group: pw:gid:members
wheel: x:10:centos,user

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

How do you create a user account?

A

useradd >user<

  • G add group id -m home dir
  • C comment (name) -s shell
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the command to create a group?

A

groupadd >groupname

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

What is the purpose of /etc/skel?

A

Files from /etc/skel are copied to the home directory of a newly created user

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

What is the command to show the when users have logged into the system?

A

last

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

How do you see the group memberships of a user?

A

groups >user<

id >user

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

How do you modify a user account?

A

usermod

  • G group -C comment
  • a append (in conjunction with -G)