Operating System - HP-UX
1832592 Members
3469 Online
110043 Solutions
New Discussion

/etc/passwd not updating !

 
Aravind_3
Frequent Advisor

/etc/passwd not updating !

I am executing the following commands:

#/usr/sbin/usermod -d /data/userA -l userA userB
#/usr/sam/lbin/usermod.sam -S /etc/passwd -p 2cDrpz8Xelew6 userA

The First command says
Login userA is not unique.

Second Command says
Login userA does not exist.

/etc/passwd has no entries for userA.
Why it is saying userA is not unique ?

Thanks
Aravind
11 REPLIES 11
melvyn burnard
Honored Contributor

Re: /etc/passwd not updating !

are you using NIS or NIS+?
that may be why you have tyhese symptoms
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
Aravind_3
Frequent Advisor

Re: /etc/passwd not updating !

Another question,
How do i know that i have NIS or NIS+ ?
Aravind_3
Frequent Advisor

Re: /etc/passwd not updating !

I confirmed that i have NIS here..and not NIS+

So is it because i don't have NIS+ ?
If so, what is the work aroud ?

john korterman
Honored Contributor

Re: /etc/passwd not updating !

Hi,
next question: does userA exit on the NIS server? If yes, userA has to be managed from there.

regards,
John K.
it would be nice if you always got a second chance
melvyn burnard
Honored Contributor

Re: /etc/passwd not updating !

I am not sure here, but I believe you would need to do this on the NIS master server to get it set correctly. Maybe someone with more NIS knowledge can confirm/repudiate this.
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
Aravind_3
Frequent Advisor

Re: /etc/passwd not updating !

The machine on which am working itself is the NIS server.

userA does not exists on the NIS server.
only userB is existing.

If I do
#/usr/sbin/usradd -m -g admingroup -d /data/userA -s /bin/false userA
#/usr/sam/lbin/usermod.sam -S /etc/passwd -p 2cDrPzxe1ew6 userA

the /etc/passwd is updated.

Why am i not able to do it with usernmod ?

Elif Gius
Valued Contributor

Re: /etc/passwd not updating !

It says this because you can't modify a not known user "userA".
If userA does not exist in /etc/passwd, that means there is no user on the system.

You have to creat userA with "useradd".
Aravind_3
Frequent Advisor

Re: /etc/passwd not updating !

I added uesrA with useradd command.
It reflected in /etc/passwd.

Now if try usermod on the same user, it says Login 'userA' not unique.


I am wondering if it is a problem with usermod command option am specifying ?

OR

Any bug in the usermod execution or any patches ?


Elif Gius
Valued Contributor

Re: /etc/passwd not updating !

HI,

RTFM...it says:
"...The usermod command is aware of NIS user and group entries. Only local users and groups may be modified with this command. Attempts to modify an NIS user or group will result in an error. NIS users and groups must be administered from the NIS server..."
john korterman
Honored Contributor

Re: /etc/passwd not updating !

Hi again,
on two systems, a 10.20 and a 11.0, I created userB and tested the two commands of your opening statement. All commands exited with "0", which resulted in /etc/passwd being updated and the home directory for userA to be created.
However, there is no NIS on any of the two machines. Is the home directory by any chance NFS mounted?

regards
John K.
it would be nice if you always got a second chance
Aravind_3
Frequent Advisor

Re: /etc/passwd not updating !

The problem got solved!!
But i have a query.

usermod is supposed to update the /etc/passwd file whenever it modifies the existing user.
This was not happening.

usermod was contacting the NIS database from the neighbouring machine.
we checked that in a neighbouring machine (nclass1), there is a directory of the test machine (nclass1)under
/var/yp/nclass2

We moved this directory to /var/yp/nclass.back

Now if i try to modify userA, i can do it without any problem.

Can you tell me why does it contacts a different machine to look up for the NIS database. ?

Thanks
Aravind