Recently I got a question that read as follows:
How do I force user foo to change a password at the first time login using ssh?
As a sys admin you may need this kind of facility. There are many ways to achieve this.
You can set empty/null password and use passwd command to expire password. This will result into immediate password change for the first time.
For example you just need to type following two commands:
# usermod -p â€œâ€ foo
# chage -d 0 foo
You can also ignore first command if foo is already exists in system.
|Category||List of Unix and Linux commands|
|Network Utilities||dig • host • ip • nmap|
|Package Manager||apk • apt|
|Processes Management||bg • chroot • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time|
|Searching||grep • whereis • which|
|User Information||groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w|