Thursday, October 7, 2021

thumbnail

How to Configure NIS client on Ubuntu_20 and Ubuntu_18

Configuring NIS Client on Ubuntu_20 and Ubuntu_18 version




1. Use the following nisclient_ubuntu20.sh script to configure the nisclient on ubuntu 20 system.

# nisclient_ubuntu20.sh
#!/bin/bash

## Install NIS and RPCbind packages
## During this step you need to enter the domain for NIS

apt-get install -y rpcbind nis

## domain can be updated under incase if you have entered wrong one during the setup /etc/defaultdomain 

## Add the following line to /etc/yp.conf

NISSERVER1="<NIS Server FQDN Name"
NISSERVER2="NIS Server2 FQDN Name"
DOMAIN="<NIS domain that has configured in your network>" echo "domain $DOMAIN server $NISSERVER1" >> /etc/yp.conf echo "domain $DOMAIN server $NISSERVER2" >> /etc/yp.conf ## Edit /etc/nsswitch.conf ## For Ubuntu 20.04 sed -i 's/systemd$/systemd nis/g;s/files$/files nis/g;s/dns$/dns nis/g' /etc/nsswitch.conf ##update NIS Domain echo "<NIS Domain>" > /etc/defaultdomain ## Restart NIS service systemctl restart rpcbind systemctl restart nis

2. Use the following nisclient.sh script to configure the nisclient on ubuntu 18 system.

# nisclient_ubuntu18.sh
#!/bin/bash

## Install NIS and RPCbind packages
## During this step you need to enter the NIS domain 

apt-get install -y rpcbind nis

## domain can be updated under /etc/defaultdomain

## Add the following line to /etc/yp.conf

NISSERVER1="<NIS Server FQDN Name"
NISSERVER2="<NIS Server2 FQDN Name"
DOMAIN="NIS Domain" echo "domain $DOMAIN server $NISSERVER1" >> /etc/yp.conf echo "domain $DOMAIN server $NISSERVER2" >> /etc/yp.conf ## Edit /etc/nsswitch.conf ## For Ubuntu 20.04 sed -i 's/systemd$/systemd nis/g;s/compat$/compat nis/g;s/dns$/dns nis/g' /etc/nsswitch.conf ##update NIS Domain echo "NIS Domain" > /etc/defaultdomain ## Restart NIS service systemctl restart rpcbind systemctl restart nis


Subscribe by Email

Follow Updates Articles from This Blog via Email

No Comments

Powered by Blogger.