Lock Flashcards

(22 cards)

1
Q

What is the purpose of lock commands in Linux?

A

To control account access by locking/unlocking accounts and enforcing password policies

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

Name commands used for account locking/unlocking.

A

passwd, usermod, chage

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

What does the passwd command do?

A

Manages user passwords and account locking/unlocking

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

Example to lock an account using passwd?

A

sudo passwd -l rterrance

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

Example to unlock an account using passwd?

A

sudo passwd -u rterrance

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

What happens when an account is locked?

A

Disables the user’s password, preventing login

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

Why is unlocking useful?

A

Restores password-based login

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

Why use locking instead of deleting?

A

For temporary access suspension without removing the account

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

What does the usermod command do?

A

Modifies user account details, including locking/unlocking

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

Example to lock an account using usermod?

A

sudo usermod -L rterrance

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

Example to unlock an account using usermod?

A

sudo usermod -U rterrance

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

What does -L option in usermod do?

A

Disables the password, blocking login

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

What does -U option in usermod do?

A

Re-enables login by unlocking the account

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

What does the chage command do?

A

Manages password expiration and aging policies

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

Syntax for chage?

A

chage [OPTIONS] [USERNAME]

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

Example to set password to expire every 30 days and warn 7 days before?

A

sudo chage -M 30 -W 7 rterrance

17
Q

What does -M option in chage do?

A

Sets maximum password age

18
Q

What does -W option in chage do?

A

Sets warning period before expiration

19
Q

Command to view password aging info?

A

sudo chage -l rterrance

20
Q

Example to set account expiration date?

A

sudo chage -E 2025-12-31 jdoe

21
Q

What does -E option in chage do?

A

Disables account after the specified date

22
Q

Why use chage?

A

Ensures passwords are updated regularly and accounts are not left active indefinitely