Operating System - HP-UX
1819903 Members
2465 Online
109607 Solutions
New Discussion юеВ

Re: /usr/sam/lbin/usermod.sam

 
Shabu Khan-2
Frequent Advisor

/usr/sam/lbin/usermod.sam


Hello All,
I am automating root password changes across the Enterprise (800+ servers) using Opsware as the platform, it provides a OGSH (Opsware Global Shell), works the same fashion as ssh.

Here is the problem.
I am using this command line to do that:
/usr/sam/lbin/usermod.sam -F -p ${NEW_PASS_KEY[0]} root

It worked on almost all of them except for around 25+ servers, when I run it from the command line on the server I get the prompt back and a return code of '0' (echo $?) but it actually doesn't update /etc/shadow, for e.g. here is the sequence

[root@myserver:/root]# grep root /etc/shadow
root:JTPm1inSzOEwE:13767::::::
ebroot:*:13292::::::
[root@myserver:/root]# /usr/sam/lbin/usermod.sam -F -p iqIWHOhzjmAiA root
[root@myserver:/root]# echo $?
0
[root@myserver:/root]# grep root /etc/shadow
root:JTPm1inSzOEwE:13767::::::
ebroot:*:13292::::::

The permissions for /etc/passwd and /etc/shadow looks the same across the enterprise, pwck doesn't show problems ...

This is a 11.11 box and the patch bundles are not too old either.

ANy thoughts?

Thanks,
Shabu

Any thoughts?
2 REPLIES 2
F Verschuren
Esteemed Contributor

Re: /usr/sam/lbin/usermod.sam

hi,

usermod.sam does only works when the user is not logged in, if you use sudo please logoff all root users and retry...

ps there are some more ways to do thi via scripting (just searce on passwd change) in the forem
Shabu Khan-2
Frequent Advisor

Re: /usr/sam/lbin/usermod.sam


Thanks for responding.

The -F option will force it to change it, no need to log off anyone.

I'll search the forum with 'passwd change', I did that earlier and didn't find anything related to my issue, but I'll try again.

Thanks,
SHabu