Operating System - Linux
1822525 Members
2603 Online
109642 Solutions
New Discussion юеВ

Re: force users to change password on next log in

 
Martin Corona
New Member

force users to change password on next log in

I have used chage -d 0 username upon creating a new account. For some reason that won't work a second time.

Anyone know of a web based tool that will let user's request a password reset automatically?

I also would like to send email notification to users that their password on servername will expire starting at 30 days from expiration.
4 REPLIES 4
Steven E. Protter
Exalted Contributor

Re: force users to change password on next log in

The passwd command is used to do both of those functions.

man passwd

passwd -k will force a change at next login.

passwd -w will determine the number of days before expiration the user will start to get notification that their password needs to be changed.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Jerome Henry
Honored Contributor

Re: force users to change password on next log in

I still like the 'chage' command, which lets you warn users before compelling them to change, set up automatic password duration and so on.
But chage -d 0 is nbot the way, here you just indicate that the password was last changed on 1st jan 1970, which is not what you need.
Try chage -M 30 -W 7 username, to set up 30 days password validity, warn to change 7 days before deadline.

man chage for details

I 'm not aware of any graphical tool apart Webmin, I think that the e mail idea would require a script...

Hope it helps

jerome Henry
You can lean only on what resists you...
Martin Corona
New Member

Re: force users to change password on next log in

[root@backup backups]# passwd -k djmartin
Changing password for user djmartin.
Changing password for djmartin
(current) UNIX password:
New password:
Retype new password:
passwd: expired authentication tokens updated successfully.

1. As the root user, I should not be prompted for the users current password

2. -k option did not force the user to change password on next log in.

On the second response to my initial question, I don't want to give a user 30 days. New security guidelines are coming out soon internally. I will have to force all users to change passwords on their next log in.

I did add chage -l $USER to /etc/profile though. Now users will see the password info everytime they log in.
sam_111
Trusted Contributor

Re: force users to change password on next log in

Hi Martin,

I use Web Administrator tool " Webmin" to do that. You can download from webmin.org.

Check this link which I have already answered how to do it in webmin.

http://www.experts-exchange.com/Operating_Systems/Linux/Linux_Administration/Q_20764565.html


regards,

sam
"Hard Work always Pays off"