I'm trying to force a newly created user to change a password at the first time login using ssh. For security reasons I want to give him a secure password until he logs in for the first time. I did the following so far:useradd -s /bin/bash -m -d /home/foo foopasswd fooDoing chage -d 0 foo only gives me the the error Your account has expired; please contact your system administrator on ssh login.
How do I force a user to change a password at the first time login using ssh?
linux;bash;ssh;login;pam
change the age of password to 0 day syntax chage -d 0 {user-name}In this case chage -d0 foo This works for me over ssh also 