Operating System - HP-UX
1748204 Members
4024 Online
108759 Solutions
New Discussion юеВ

Re: passwd change by script or other tool is this possible

 
SOLVED
Go to solution
Reinhard Burger
Frequent Advisor

passwd change by script or other tool is this possible

We are running an application that is using a windows NT based client and the users anyway have to have an account in HP-UX to be able to connect from the client to the server part.
The users almost don't use HP-UX itself.
HP-UX is running in trusted system mode.
every time when the password of useres expire we have problems that they do not further know how to change the password on HP-UX.
Is there any way that we can give them a panel within theClient where they can enter their new password and it will be changed on the server side. The client is able to perform system commands on the server side using rpc connections.
keep it simple
8 REPLIES 8
Stefan Farrelly
Honored Contributor

Re: passwd change by script or other tool is this possible

I think the only way you can do it is to set the flag on the user account so that next time the user logs in they will be prompted themselves to change their password.

modprpw -l -e


Im from Palmerston North, New Zealand, but somehow ended up in London...
Bill McNAMARA_1
Honored Contributor

Re: passwd change by script or other tool is this possible

you can use the crypt command to encrypt the password. I'll search for the link.. be back in a second.
It works for me (tm)
Reinhard Burger
Frequent Advisor

Re: passwd change by script or other tool is this possible

Stephan

The users are notified by the client login process that the system password has expired. My problem is exactly that most of them do NOT remember how to use passwd on server side. (Maybe that sounds funny but if you have approx 100 users like that then you canimagin what will be ongoing on your phone)
keep it simple
Stefan Farrelly
Honored Contributor

Re: passwd change by script or other tool is this possible


The other alternatives are;

increase the expiry limit so they dont expire as frequently - or turn if off completely.

Create a series of passwords by setting the password for a user account, copy the encrypted password string, and when someones account expires you can write a script to replace the encrypted password for a user account (under /tcb/files/auth/) to the new one. You know yourself what the password is so you can tell them. Make a list of passwords to use.
Im from Palmerston North, New Zealand, but somehow ended up in London...
Reinhard Burger
Frequent Advisor

Re: passwd change by script or other tool is this possible

Bill
Thank you for all the links . I will try to underrstand all the details in there. So my spare time on weekend is covered :-)

Stefan
if i understand you correctly a possible sequence on how to deal with it could be :

1.) client creates a script on server side delivering userid,old passwd and new passwd as params
2.)the script has to do as
first step: check if userid is correct
second step: crypt oldpasswd and check against passwd in /tcb/files/auth/
thirth step: replace old passwd by new passwd
fourth step : reset actual age of passwd to 0 (zero)

is this more or less correct ?
keep it simple
James Beamish-White
Trusted Contributor

Re: passwd change by script or other tool is this possible

I have had this problem in the past as well, and would like to know if anyone has actually coded setprpwent() or setpwent() into a program? (Clay???) :-)

I'm not a C-bunny, so would love to have a command I can run like:

setpw username plain_text_password

I don't install perl on most of the systems I run as they are hardened and have minimal installs, so C has to be the way to go.

Cheers!
James

-If it's hard, you're doing it wrong.
GARDENOFEDEN> create light
Wodisch_1
Honored Contributor
Solution

Re: passwd change by script or other tool is this possible

Hello Reinhard,

the answer to (almost) all the questions of that kind (batching an interactive command) is to use "expect". Get it from the HP-UX porting archives...

HTH,
Wodisch