1837365 Members
3414 Online
110116 Solutions
New Discussion

Re: chown strange issue

 
joe_91
Super Advisor

chown strange issue

This is what happens..
we use this command in a script..
echo "$hostname $user_id >> $Home_dir/.rhosts
chown $user_id:$user_group $Home_dir/.rhosts

the command works fine on /etc/passwd users but fails for NIS USERS (from /etc/passwd.yp)
"chown: unknown user id"

not sure what is happening? Pl direct me

Thanks

Joe

9 REPLIES 9
Pete Randall
Outstanding Contributor

Re: chown strange issue

Where and how does $user_id get set?


Pete

Pete
Rick Garland
Honored Contributor

Re: chown strange issue

Can NIS users login to this system?
Is this system running as a NIS client?

Suraj Singh_1
Trusted Contributor

Re: chown strange issue

Where is this script called from? Is the script running with root privileges?

It is really dificult to figure out the exact cause of this problem with the details you have provided.

Pls. attached the script also.

Regards
What we cannot speak about we must pass over in silence.
joe_91
Super Advisor

Re: chown strange issue

The problem is not with the script. the problem is with chown. it works on normal users but fails on NIS users. Have anyone faced this issue?

Thanks

Joe.
Patrick Wallek
Honored Contributor

Re: chown strange issue

Do you have the "+::0:0:::" in the /etc/passwd file on this machine? Do NIS users work for anything else?
Tony Scully_2
Valued Contributor

Re: chown strange issue

Patrick's question is key -- do NIS users work for anything else, eg can you su to one of the users, create a file etc.

Are you sure that $user_id IS getting set correctly? Have you tested at the command line?

Cheers,
Tony
You CAN do that on HP
Devesh Pant_1
Esteemed Contributor

Re: chown strange issue

Try using the echo $hostname and echo $user_group to see if you get a valid group

Do you have common uids/gids in the local /etc/passwd and the NIS passwd files ?

Devesh
Ermin Borovac
Honored Contributor

Re: chown strange issue

One possible culprit is pwgrd caching daemon, which has problems when NIS is in use. You may want to try restarting pwgrd to see if it fixes this problem.
Oliver Stoklossa
Frequent Advisor

Re: chown strange issue

Maybe you could also check the settings in the /etc/nsswitch.conf

Had a similar issue long time ago because of strange settings in group and passwd section.

Regards
Oli