2

I need to expire all the new and manually reset passwords in a server. When a new user logs into the server the first time it should force him to change the password. My first guess is that I have to use the command chage -d 0

2

After creating user you may use

[root@localhost~]# chage -d 0 username  

to force a user to change their password at next logon on a Linux.

If you want to automatically do that every time just after new user add. For that you edit the configuration file which locate at

[root@localhost] # vi /etc/default/useradd

Search Expire and Make it

Expire=0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.