HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

How To Determine What Netgroups A User Belongs To

 
robs58
Occasional Advisor

How To Determine What Netgroups A User Belongs To

In an NIS environment, what command given at the CLI will allow me to view/determine any/all netgroups that a user belongs to?

I am running HP-UX ver. 11.11 in a large NIS environment.

Note: I heard that the following command would provide the names of any/all netgroup that user "smith" belongs to. Unfortunately, it did not work. All helpful comments are
welcomed and appreciated.

# ypmatch 'smith.*' netgroup.byuser
ypmatch: can't match smith.*.
Reason: no such key in map


Thanks ahead of time!

Roger Clem
3 REPLIES
Steven E. Protter
Exalted Contributor

Re: How To Determine What Netgroups A User Belongs To

Shalom Roger,

how about an OS command.

id

That worked for me on NIS slaves.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Nido
Trusted Contributor

Re: How To Determine What Netgroups A User Belongs To

Hi,

#ypwhich
ypwhich will return name of NIS server

#ypwhich -m
-m : will return available maps on NIS.

#ypwhich -m |grep -i netgroup


And your answer:

#ypcat -k netgroup |grep -i

Please find some documentation in docs.hp.com for more information on NIS.

Cheers!!
" Let Villagers Be Happy!! "
robs58
Occasional Advisor

Re: How To Determine What Netgroups A User Belongs To

Thanks for your help guys!

Nido: Your answer was especially helpful!

All the best,

Roger Clem