How do I force a user to change a password at the first time login using ssh?
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
Depending on the version passwd you can try
passwd -f
: Forces the user to change password at the next login by expiring the password for name.passwd -e
orpasswd --expire
: Immediately expire an account's password. This in effect can force a user to change his/her password at the user's next login.