Difference between revisions of "NIS"

From ArchWiki
Jump to: navigation, search
m (How to set up a NIS client)
(update location of domainname configuration file and ditch compat nsswitch.conf setup)
Line 13: Line 13:
 
  # pacman -S yp-tools ypbind-mt
 
  # pacman -S yp-tools ypbind-mt
  
Next put your NIS domain name into the file /etc/defaultdomain (create the file if it doesn't exist).
+
Next put your NIS domain name into the file /etc/conf.d/nisdomainname.
  
 
Now edit the /etc/yp.conf file and add your ypserver or nis server.
 
Now edit the /etc/yp.conf file and add your ypserver or nis server.
Line 30: Line 30:
 
If it works you will, among other things, see the contents of the NIS user database (which is printed in the same format as /etc/passwd).
 
If it works you will, among other things, see the contents of the NIS user database (which is printed in the same format as /etc/passwd).
  
To actually use NIS to log in you have to edit /etc/nsswitch.conf.  Modify the lines for passwd, group and shadow to say the following:
+
To actually use NIS to log in you have to edit /etc/nsswitch.conf.  Modify the lines for passwd, group and shadow to read:
  
  passwd: compat
+
  passwd: files nis
  group: compat
+
  group: files nis
  shadow: compat
+
  shadow: files nis
 
+
Finally, for NIS clients you have to add at least a special line to each of the files /etc/passwd, /etc/group, and /etc/shadow:
+
 
+
# echo "+::::::" >> /etc/passwd
+
# echo "+:::" >> /etc/group
+
# echo "+::::::::" >> /etc/shadow
+
  
 
And then do not forget
 
And then do not forget
Line 47: Line 41:
  
  
See [http://www.tldp.org/HOWTO/NIS-HOWTO/settingup_client.html#AEN313 section 7.5 of The Linux NIS HOWTO] for further information on configuring /etc/nsswitch.conf.
+
See [http://www.tldp.org/HOWTO/NIS-HOWTO/settingup_client.html section 7 of The Linux NIS HOWTO] for further information on configuring NIS clients.
  
 
==More resources==
 
==More resources==

Revision as of 15:59, 8 June 2011

Tango-document-new.pngThis article is a stub.Tango-document-new.png

Notes: please use the first argument of the template to provide more detailed indications. (Discuss in Talk:NIS#)

Introduction

NIS is a protocol developed by Sun to allow one to defer user authentication to a server. The server software is in the ypserv package, and the client software is in the yp-tools package. ypbind-mt is also available, which is a multi threaded version of the client daemon.

Note: obviously this article is far from finished. hopefully in the future that will change, but in the meantime check the More resources section.

How to set up a NIS client

The first step is to install the tools that you need. This provides the configuration files and general tools needed to use NIS.

# pacman -S yp-tools ypbind-mt

Next put your NIS domain name into the file /etc/conf.d/nisdomainname.

Now edit the /etc/yp.conf file and add your ypserver or nis server.

ypserver your.nis.server

Start the rpcbind and ypbind daemons (add them to your rc.conf file if you want it to start automatically).

# /etc/rc.d/rpcbind start
# /etc/rc.d/ypbind start

To test the setup so far you can run the command yptest:

# yptest

If it works you will, among other things, see the contents of the NIS user database (which is printed in the same format as /etc/passwd).

To actually use NIS to log in you have to edit /etc/nsswitch.conf. Modify the lines for passwd, group and shadow to read:

passwd: files nis
group: files nis
shadow: files nis

And then do not forget

# /etc/rc.d/ypbind restart


See section 7 of The Linux NIS HOWTO for further information on configuring NIS clients.

More resources