-   Linux - Security (
-   -   Forcing password change at first login (

vsp_123 01-26-2004 11:42 AM

Forcing password change at first login
Hi all,

How do I enforce users to change their passwords the first time they logon?

druuna 01-26-2004 12:36 PM

This is one way of doing it. It forces a user to change his/her password, can be used any time you (root) want:

$ chage -d 0 -M 999 <user>

If you are using password aging you don't need the -M 999 part.

vsp_123 01-26-2004 12:40 PM

Thanks, that solved it.

vsp_123 01-26-2004 06:22 PM

Hi all,

Another issue. When I do a
chage -d 0 -M 999 <username>
we are assuming that the user is going to have a direct access to the machine's console so will be prompted for a change password stuff by the system. But when the user tries this with "ssh" session, he gets bombed out when first time logging in. It asks for password first time and when he enters the right password, it says that

Server responded "Connection closed".
Connection to the remote host was lost.

and nothing more. This is because SSH does not know how to handle the change password.

Any clarifications?


druuna 01-27-2004 12:36 AM

I don't understanf why it isn't working with ssh:

Changed the password for one of the users and tried to log in using ssh:

$ ssh -l someuser inferno
someuser@inferno's password:
Password changing requested. Choose a new password.
Warning: Your password has expired, please change it now
Old Password:
New password:
Re-enter new password:
Password changed

No problems whatsoever. Did you check the ssh settings?

vsp_123 01-27-2004 11:44 AM

Sorry. I forgot to mention that the SSH that I was talking about is the ssh client on windows side. Do you think it will still work if somebody tries to connect from a windows box to this linux ws using ssh client?
i was not successful atleast.
Please reply when convenient. Thanks


druuna 01-27-2004 11:57 AM

I haven't used windows in over 5 years, so windows related questions I cannot (or hardly) answer. I will give it a try:

I've heard about a program called putty that is suposed to be a good ssh client for windows.

Will it allow users to change their password? I really don't know. But if I guess it seems logical that it should. Passwords should change on a regular base and if your only access is an ssh client.......

All times are GMT -5. The time now is 11:48 AM.