Operating System - HP-UX
1834611 Members
3729 Online
110069 Solutions
New Discussion

Re: How to setup nsswitch.conf

 
Sudhakar J_1
Advisor

How to setup nsswitch.conf

Hi,

Is any one have how to setup nsswitch.conf to lookup multiple nis domains for user and group. I made ypbind to bind to two domains and tried the following in nsswitch.conf but it is not working.

passwd: nis(domain=engg) nis(domain=sales)

Any help is appreciated
tomorrow is just another day
5 REPLIES 5
Karthik S S
Honored Contributor

Re: How to setup nsswitch.conf

Man .... I told you it is not possible ;-)

Well I wcan suggest you a workaround but not a solution. Make the entries in the /etc/nsswitch.conf as follows,

passwd: files

(Before doing this do a
cp /etc/nsswitch.conf /etc/nsswitch.conf.nis
cp /etc/nsswitch.conf /etc/nsswitch.files )

And add all the NIS users to the /etc/passwd file from both of the NIS Domains. Now define a if condition in the /etc/profile such that if a user that belongs to NIS domain1 ,logs in to the system it should do the follwoing,

configure ypbind such that it binds to NIS Domain1 and do a
cp /etc/nsswitch.conf.files /etc/nsswitch.conf

and at the end of /etc/profile add,

su - username

And ofcourse the user will be prompted for the password again.

Configure similarly for NIS Domain2 with in the if loop.

However this method has practical limitations for instance if multiple users try to login at a given point of time you might run into difficulties.

If it sounds stupid to you feel free to hit me on my face when I meet you on monday.

But, I am pretty sure our forums Gurus can give you a better solution ;-)

Enjoy the weekend

-Karthik S S
For a list of all the ways technology has failed to improve the quality of life, please press three. - Alice Kahn
Karthik S S
Honored Contributor

Re: How to setup nsswitch.conf

No new replies to this post???

-Karthik S S

No points for this please.
For a list of all the ways technology has failed to improve the quality of life, please press three. - Alice Kahn
Sudhakar J_1
Advisor

Re: How to setup nsswitch.conf

I was able to bind to two domains and i used a common user in nis and then thru profile script it would ask which domain user want to login and based on that defaultdomain user will be able to login, again in this also user needs to supply user name and password twice.

What i want is since nsswitch.conf has machanism to switch from say hosts from files to nis then to dns using notfound=continue keywords, is there any way to specy multiplr nis entries so that if a user is not part on domain (notfound) then process should switch to the next avialable nis domain(continue)

Any help is appreciated
tomorrow is just another day
Steven E. Protter
Exalted Contributor

Re: How to setup nsswitch.conf

I attaching a pretty standard setup.

It would not take much effort to integrate NIS into it.

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
Karthik S S
Honored Contributor

Re: How to setup nsswitch.conf

SEP,

But I can't see the script.

Thanks,
Karthik S S
For a list of all the ways technology has failed to improve the quality of life, please press three. - Alice Kahn