Operating System - HP-UX
1833381 Members
3626 Online
110052 Solutions
New Discussion

password changing problem. with sudo. [ hp-ux 11i ] !!!

 
rveri
Super Advisor

password changing problem. with sudo. [ hp-ux 11i ] !!!

Hi all ,

I have 50 hp-ux servers. And trying to add a user on the all server , through a script from a different system , through ssh .

I have done first step by this command with for - loop:

for i in `cat 50servers.list`
do
ssh -$i "sudo useradd -u220 -d/home/finance8 ar -s/usr/bin/sh -gusers -c 'Mohan K Babu/Finance/8' -m finance8 "
done

(found user added to all the systems)

Now wants to set the password:
I am running this commands ,

ssh $i "sudo passwd finance8"
ssh produx22 "sudo passwd -f finance8"

But its giving the following error:
$ ssh produx22 "sudo passwd finance8"
+ ssh produx22 "sudo passwd finance8"
Changing password for finance8
Last successful password change for finance8: NEVER
Last unsuccessful password change for finance8: Fri Mar 18 12:20:00 2005

pam_chauthtok: System error
$

Any idea as whats wrong.

Thanks,

Regards,
R.Veri.


5 REPLIES 5
RAC_1
Honored Contributor

Re: password changing problem. with sudo. [ hp-ux 11i ] !!!

password command has to be used interactively. For this you will have to use expect tool, or usermod.sam command.

/usr/lbin/usermod.sam -p "echo "12345abcdef"|/usr/lbin/makekey" -u "user_name"

The password will be set to 12345abcd (ef are salt chars) the password has to be 10 chars long (8 char pass + 2 chars salt)
There is no substitute to HARDWORK
rveri
Super Advisor

Re: password changing problem. with sudo. [ hp-ux 11i ] !!!

Hi Anil ,

Thanks for the replies,

1] Does expect tool is avaialable for hp-ux

2]As you told password has to be 10 characters long , 8 + 2 salt characters , whats this salt characters. Whats will be the effective password.

please suggest ,

Thank you,

R.Veri.
RAC_1
Honored Contributor

Re: password changing problem. with sudo. [ hp-ux 11i ] !!!

In the command that I gave you password will be 12345abcd. the salt chars are used for preparing hash value during encryption processes.

You can get expcat tool bellow.
http://hpux.connect.org.uk
There is no substitute to HARDWORK
rveri
Super Advisor

Re: password changing problem. with sudo. [ hp-ux 11i ] !!!

Thanks a lot Anil ,

I will update as i solve this issue,
Untill next time ,
Have a great weekend.

R.Veri.

Adam Vollmar
Occasional Advisor

Re: password changing problem. with sudo. [ hp-ux 11i ] !!!

Hi,

I had the same problem a few days ago; it should work with the following option:
ssh -xt $Host "sudo passwd sapadm"

Regards
Adam