Tips & Tweaks

How to configure NIS server

How to configure NIS server

Configuring NIS Server
Configuring NIS Server

NIS SERVER

To Set up an NIS server on your computer, you’ll need to install the ypserv and yp-tools RPM.

NIS clients and NIS servers are organized in NIS domains.If you are using NIS, you can find out the name of your NIS domain by using this command:
# domainname

If this returns a blank or none, you’ll need to define the NIS domainfor your system with the following command :
# domainname nisdomain

NIS provides you with more than a shared authorization database.With NIS, you can provide shared access to any kind of information. By default NIS shares the following files:

1. /etc/passwd
2. /etc/group
3. /etc/hosts
4. /etc/rpc
5. /etc/services
6. /etc/protocols
You can configure NIS to share other files as well. This is easy to configure in the NIS configuration file, /var/yp/Makefile.
NIS services require at least one NIS master server where the centralized NIS database files, known as maps, are stored.
NIS changes require an update to the map on the master server.
You can have only one NIS master server per NIS domain.
For larger networks, you may also want an NIS slave server.NIS Server take copies of the NIS maps from the master server.
NIS clients can then get their configuration files from either the master server or a slave server.
You can have multiple NIS Slave Servers on a network.
NIS clients are systems that use information from NIS server. NIS clients don’t store any information that is contained in the NIS database; whenever that information is needed, it is retrieved from a server.

STARTING THE NIS SERVICE

Once you have edited the configuration files for your computer and network, you can start the NIS service. You can do so with the ypinit command in the /usr/lib/yp directory.
This command has two key switches
-m is used to create a master NIS server and
-s is used to create a slave NIS Slave.

# /usr/lib/yp/ypinit –m

Configuring NIS Server and NIS Client

Step 1. Assign 192.168.0.254 to NIS server and 192.168.0.1 to NIS client.

Step 2. Install ypserv, ypbind, and yp-tools packages by using RPM command
# rpm –q ypserv
# rpm –ivh ypserv-*
# rpm –ivh yp-tools*
# rpm –ivh ypbind*

Step 3. Edit /etc/sysconfig/network file to set your NIS domain name. This will take effect when you reboot your machine.
NETWORKING =yes
HOSTNAME=server.example.com
NISDOMAIN=nisdomain

Step 4. To set NIS domain name without rebooting the machine run the command given below
# domainname nisdomain

Step 5. Start portmap and ypserv service by using the following commands:
# service portmap start
# service ypserv start

Step 6. Generate the NIS maps (database) by running ypinit as shown below
#/usr/lib/ypinit –m

Step 7. Now start NIS password update daemon using the following command.
# service yppasswdd restart

Step 8. Create user name user1 and user2 by using adduser command

Step 9. Now go to /var/yp directory. Run make command it update your password and group information which is accessed by NIS client
# cd /var/yp
# make

Configuring NFS Server

Step 1. Mount home directory in /etc/exports file
/home *(rw,sync)

Step 2. Run exportfs –a to commit the job

Step 3. Now start nfs service
#service nfs restart

Client Side Configuration

Step 1. Use authconfig command to configure NIS client

Step 2. Test your NIS client log into the client machine as root. Test the client-server connection by typing
#ypcat passwd

Tags
Show More

ritesh

A Professional Tech Blogger who blogs at www.vritesh.com and also offers SEO Services for achieving top search engine rankings. Contact me for some free SEO Services which can be useful for your websites!

Leave a Reply

Your email address will not be published. Required fields are marked *

Close

Adblock Detected

Please consider supporting us by disabling your ad blocker