FreeOS.com logo

FreeOS Most Popular
* Most Read stories
* Commented Stories
* Active Categories
* Non Linux Section
* User Submitters
* Top Polls
* Top Authors
* Top Reviews
* Top Rated
* Top Search Terms

Top Articles
* Writing a Linux device driver
* The Linux filesystem explained
* Samba NT Domain Controller
* Setting up Squid as your caching HTTP/FTP proxy
* Web server tutorial - Part 1

FreeOS Highlights
* Howtos (72)
* Reviews (20)
* Opinions (18)
* Interviews (8)
* News (3)

My FreeOS

Nick:
Pass:
Register

Forgot your password?

Contact Us
Contact Us

       

Project: FreeBSD triangle Howtos triangle

Configure a NIS and NFS client on a FreeBSD box

By Aditya Kulkarni <aditya@freeos.com>
Posted: ( 2001-02-19 12:13:41 EST by )

Now that you have installed FreeBSD, would you like to use your FreeBSD box as a client on a network running NIS? Well, here is an article just for you.

An article explaining how to configure a NIS and NFS client on a FreeBSD box

What is NIS and how does it work?

NIS is an RPC-based client/server system that allows a group of machines within an NIS domain to share a common set of configuration files. This permits a system administrator to set up NIS client systems with only minimal configuration data and add, remove or modify configuration data from a single location.

An NIS client establishes what is called a binding to a particular NIS server using the ypbind daemon. Ypbind checks the system's default domain (as set by the domainname command) and begins broadcasting RPC requests on the local network. These requests specify the name of the domain for which ypbind is attempting to establish a binding. If a server that has been configured to serve the requested domain receives one of the broadcasts, it will respond to ypbind, which will record the server's address. If there are several servers available (a master and several slaves, for example), ypbind will use the address of the first one to respond. From that point on, the client system will direct all of its NIS requests to that server. Ypbind will occasionally ‘ping’ the server to make sure it is still up and running. If it fails to receive a reply to one of its pings within a reasonable amount of time, ypbind will mark the domain as unbound and begin broadcasting again in the hopes of locating another server.

We will not go in-depth of technical details about slave and master NIS servers, but instead will run you through some configurations.

Configure NIS on client as follows:

Edit the /etc/rc.conf file and add the following lines to it

nis_client_enable="YES"
nisdomainname="nis_domain_name"
nis_client_flags=""

Assuming that nis_domain_name is your nis domain name.

Next edit the /etc/group file as:

Add a + at the end of the file

Something similar to the following

dialer:*:68:
network:*:69:
nogroup:*:65533:
nobody:*:65534:
+

Next edit /etc/master.passwd without modifying /etc/passwd file. This is important.

Add the following line at end of the file
+:::::::::
This should be similar to the following below

pop:*:68:6::0:0:Post Office Owner:/nonexistent:/sbin/nologin
nobody:*:65534:65534::0:0:Unprivileged user:/nonexistent:/sbin/nologin
+:::::::::

Finally edit the /etc/hosts and /etc/host.conf files to contain the localhost and nisdomain nameservers.

For /etc/host.conf file:

Uncomment the # at the #nis statement if NIS is configured.

For /etc/hosts file:

Add the +:: at the end of the file containing local and NIS server in the list.

Have something similar to this:

127.0.0.1 localhost.lucifer.abc.net localhost
198.162.0.10 lucifer.abc.net lucifer
198.162.0.1 damien.abc.net damien
+::

where lucifer is your BSD machine name and damien is your NIS server .

What is NFS and what does it do?

NFS allows you to share directories and files on one machine with one or more machines via the network they are attached to. Using NFS, users and programs can access files on remote systems as if they were local files.

NFS is composed of two sides - a client side and a server side. Think of it as a want/have relationship. The client wants the data that the server side has. The server shares its data with the client. In order for this system to function properly a few processes have to be configured and running properly. The server has to be running the following daemons:

nfsd - The NFS Daemon which services requests from NFS clients.
mountd - The NFS Mount Daemon which actually carries out requests that nfsd passes on to it.

The client side only needs to run a single daemon:

nfsiod - The NFS async I/O Daemon which services requests from its NFS server.

For the NFS client add the line in your /etc/rc.conf file

nfs_client_enable="YES"

You now need to mount the NFS on the client by typing the following command:

# mount server:/home /home

This will mount /home on the server on /home on the client. If everything is setup correctly you should be able to go into /home on the client and see all the files that are on the server.

By default it mounts the NFS in /usr/home directory

To make these changes permanent edit /etc/fstab and add the necessary home directories to mount.

For e.g., our /etc/fstab would show:

192.168.0.1:/home /home nfs rw

Once this is done, NIS is configured on your FreeBSD client and up and running.

For a more detailed description, see the FreeBSD handbook

Other articles by Aditya Kulkarni

Current Rating: [ 6.2 / 10 ] Number of Times Rated: [ 30 ]

More Howtos
* Fast & dirty way for dualbooting FreeBSD & Linux
* Getting started with FreeBSD
* Compiling the FreeBSD kernel
* Configure a NIS and NFS client on a FreeBSD box

Contents
  Howtos
Links
  Articles
  Howtos
  Interviews
  Reviews
  Websites
News

FreeBSD
About FreeBSD

Print It!
Printer Friendly Version