Operating System - HP-UX
1832542 Members
5885 Online
110043 Solutions
New Discussion

command to change password remotely

 
SOLVED
Go to solution
jok llamera
Advisor

command to change password remotely

fellas,

I have 3 machines that needs new added accounts in password file be sync. All I need is, once I change the password on one of the machines, it will propagate to the other two. My problem with remote execution is that passwd command needs interactive inputs, so I can't changed the password remotely. Editing password file is also a risky thing to do. Is there a tool to change the password remotely like executing a command and passing the as the parameter of the command. FYI, NIS is difinetely not my option and is not possible to my setup.

thanks
joks

Excelence is not an act but a hobby
5 REPLIES 5
Uday_S_Ankolekar
Honored Contributor

Re: command to change password remotely

Hi,

You may get answer in this link.

http://forums.itrc.hp.com/cm/QuestionAnswer/1,1150,0x9e517e990647d4118fee0090279cd0f9,00.html

Good luck,
-USA-
Good Luck..
Mark van Hassel
Respected Contributor
Solution

Re: command to change password remotely

Hi,

There is a trick to do this via telnet:

for HOST in `cat hostlist`
do
( sleep 2
echo ${username}
sleep 2
echo ${oldpasswd}
sleep 2
echo "passwd"
sleep 2
echo p # when trusted system
sleep 2
echo "${newpasswd}"
sleep 2
echo "${newpasswd}"
sleep 2
echo exit
sleep 5 ) | telnet $HOST
done

The sleeps are necessary to slow the echo statements.

Hope this Helps.

MvH
The surest sign that life exists elsewhere in the universe is that none of it has tried to contact us
Tim D Fulford
Honored Contributor

Re: command to change password remotely

Jok

(I hope I got your name right!)

Whilst all the above is perfectly OK you are re-inventing the wheel! There are lots of products which do this (and more)

NIS, NIS+, dce, Kerbros, LDAP....

Probably the easiest is NIS/NIS+. They have the added advantage of being free (well once you've paid for HP-UX...).

I would seriously look at NIS/NIS+ as it will simplify the management of your computers for passwords (hosts, groups, services .....).

I have yet to see an implementation of automated password syncing that is not flawed in some way. In general, they require constant attension, hence you spend more time fixing problems, less time doing useful things.

As the guys in the USA say, thats my 2 cents worth

Tim
-
Wodisch
Honored Contributor

Re: command to change password remotely

Hello Joks,

just use SAM for one time to modify the password of a
dummy user, then look into the "SAM log" - in there
you will find the command line SAM uses to actually do
it!
Next time use this command...

HTH,
Wodisch
jok llamera
Advisor

Re: command to change password remotely

hi all, its working now..I have used remsh instead of telnet, but the concept is the same..

thanks a lot..
joks
Excelence is not an act but a hobby