Jacques Duplessis
by Jacques Duplessis
~1 min read

Categories

Tags

Print Friendly and PDF

User is calling and say that he forgot is password. So you need to change his password and for security reason you want to force him to change it upon his first login. The command “chage -d 0” (change aging) will force user to change his password upon first login.


Password Image

Image by Gino Crescoli from Pixabay


Change the user password, because he forgot it.

# passwd josblow


Then we set expiration date to 0, so when user login with his new password, he will have to change it before continuing.

# chage -d 0 josblow


So when the user log on the server, he will need to change his password before going forward.

$ ssh josblow@raspi1
josblow@raspi1's password:
You are required to change your password immediately (administrator enforced)
Linux raspi1.maison.ca 5.10.17+ #1403 Mon Feb 22 11:26:13 GMT 2021 armv6l

WARNING: Your password has expired.
You must change your password now and login again!
Changing password for josblow.
Current password:
New password:
Retype new password:
passwd: password updated successfully
Connection to raspi1 closed.

$ ssh josblow@raspi1
josblow@raspi1's password:
Linux raspi1.maison.ca 5.10.17+ #1403 Mon Feb 22 11:26:13 GMT 2021 armv6l
josblow@raspi1:~ $