Three methods to temporarily disable a normal account to log on to Linux
1. Modify the password column in/etc/shadow and add an exclamation point (!), With! No! Enabled
2. Use the usermod command (enable usermod-L and enable usermod-U)
3. Use the passwd command (passowd-l disabled, passwd-u enabled)
Example:
You have created an account named Nick. Please note that! Disappear?
Method 1:
[Root @ localhost Home] # grep Nick/etc/shadow
NICK :! $1 $ uqlz3mcp $ r9nmid79ckgxpzupg2wgf.: 14873: 0: 99999: 7 :::
Method 2:
[Root @ localhost Home] # usermod-l nick
[Root @ localhost Home] # grep Nick/etc/shadow
NICK :! $1 $ uqlz3mcp $ r9nmid79ckgxpzupg2wgf.: 14873: 0: 99999: 7 :::
[Root @ localhost Home] # usermod-u Nick
[Root @ localhost Home] # grep Nick/etc/shadow
NICK: $1 $ uqlz3mcp $ r9nmid79ckgxpzupg2wgf.: 14873: 0: 99999: 7 :::
Method 3:
[Root @ localhost Home] # passwd-l nick
Locking password for user Nick.
Passwd: Success
[Root @ localhost Home] # grep Nick/etc/shadow
NICK :!! $1 $ uqlz3mcp $ r9nmid79ckgxpzupg2wgf.: 14873: 0: 99999: 7 :::
[Root @ localhost Home] # passwd-u Nick
Unlocking password for user Nick.
Passwd: success.
[Root @ localhost Home] # grep Nick/etc/shadow
NICK: $1 $ uqlz3mcp $ r9nmid79ckgxpzupg2wgf.: 14873: 0: 99999: 7 :::