Operating System - HP-UX
1833847 Members
2287 Online
110063 Solutions
New Discussion

HP UX SCRIPT TO FORCE user to change password on login

 
SOLVED
Go to solution
Jim Tropiano_1
Frequent Advisor

HP UX SCRIPT TO FORCE user to change password on login

I have a script with the help of this forum which allows certain user to create a new user and add a default password. now the problem. I cannot think of a way to force the user to change his/her password on login.

The script is running as root ( permission 4755)
using /usr/sam/lbin/usermod.sam -p "d5cFfffNSRcU" ${newuser}
to create the new users password.
I have tried passwd -f ${newuser} buyt get permission denied.

Any suggestion would be helpful
5 REPLIES 5
RAC_1
Honored Contributor

Re: HP UX SCRIPT TO FORCE user to change password on login

Whay setuid, use sudo instead.
There is no substitute to HARDWORK
melvyn burnard
Honored Contributor
Solution

Re: HP UX SCRIPT TO FORCE user to change password on login

try /usr/sam/lbin/usermod.sam -p ",.." ${newuser}

Putting ,.. in the password field forces a request for a new password at next login
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
Rick Garland
Honored Contributor

Re: HP UX SCRIPT TO FORCE user to change password on login

The 'passwd -f' command will force passwd change on next login.

Examples
passwd -f
or
sudo passwd -f
(if you have sudo in play for this command)

Next time logins, system will prompt for user to change passwd

NOTE: The /usr/bin/passwd should work without problems.
Jim Tropiano_1
Frequent Advisor

Re: HP UX SCRIPT TO FORCE user to change password on login

Thank YOU that was it......Thanks.

Is there somewhere or document that has the parameter in it.
Jim Tropiano_1
Frequent Advisor

Re: HP UX SCRIPT TO FORCE user to change password on login

Thanks