Operating System - HP-UX
1752794 Members
5866 Online
108789 Solutions
New Discussion юеВ

Changing password on HPUX without asking for password

 
SOLVED
Go to solution

Changing password on HPUX without asking for password

Does anyone know how to change password of a user on a HPUX system without prompting for a password. I need to change password of a user on 100's of HPUX servers (Mostly 11.00 and 11i). I don't have expect on my systems and I don't plan on using it. If there is no command available in HPUX please help me with some perl script you may have that can accomplish the purpose.

Thanks
Ram
Hello
3 REPLIES 3
Sridhar Bhaskarla
Honored Contributor
Solution

Re: Changing password on HPUX without asking for password

Hi Ram,

All you have to do is to run the '/usr/sam/lbin/usermod.sam -p ' on the systems. Change the password of the user on one system and grab the encrypted password from /etc/passwd (non-trusted) or /tcb/files/auth (trusted) structure. You will also need to make sure that the user is not logged in when you run the usermod.sam command.

If you have any management software like Openview/Tivoli, you can take it's help to run this small script. Or if you have already setup ssh public keys also you can do it. If you don't have any of them, then you can crate '.netrc' file and use rexec. But that's the *most insecured* way and attempt only if you don't have any choice. Remove .netrc file once the task is done.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Brian Markus
Valued Contributor

Re: Changing password on HPUX without asking for password

I don't have a perl script for this, but I wrote several scripts to do something similar a few years back on both trusted and non trusted systems. I don't have them anymore, but this is what I did.

Make backups of your passwd file prior to trying anything.

For the trusted system, I used sed on all files in /tcb/files/auth/*/* to pull anything in the file between :u_pwd=
I inserted a new pass right there. It globally replaced hundreds in a matter of seconds.

On the non-trusted system, I did something similar but with the /etc/passwd file.

I found this thread that has your answer:

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=29293
[Moderator edit: The above link is no longer valid.]
Good luck.

-Brian.

When a sys-admin say's maybe, they don't mean 'yes'!
Muthukumar_5
Honored Contributor

Re: Changing password on HPUX without asking for password

If you want to make that user login without passwd on 100's of hpux server then go for r* commands / s* commands.

We are using r* commands on rlogin on 100's of internal machine's without passwd.

For users make setup as,

-- /etc/hosts.equiv ---
+ testusr

or

+ root

On every machine so that it will access to that user login with passwd.

If you are using trusted system's then you have to give supported to the rlogind

And more you have you have to have rlogind to support r* commands

Note: r* commands are non-secure. You can use s* (sshd) commands to get secure on this.


If you want to make user's without using r* / s* setup then make user's passwd information on sam as "Allow null passwd"

It will not ask passwd or simply delete the passwd entry on /etc/passwd file of user ( on non-trusted mode only )

Like,
user::

Easy to suggest when don't know about the problem!