Two Essential Services for Managing a Unix/Linux Network

In Unix and Linux environments, certain services play a central role in managing users, permissions, and data sharing between machines. Among them, NIS (Network Information Service) and NFS (Network File System) are two historical technologies that remain widely used in enterprise infrastructures.
This article explains how they work, their advantages, and their main use cases.

🔐 NIS: Centralizing Authentication and Network Information

What is NIS ?

The Network Information Service, developed by Sun Microsystems, is a system that centralizes administrative information across a fleet of machines :

  • users (passwd and shadow files)
  • groups (group file)
  • network hosts
  • passwords
  • various services and configurations

The goal of NIS is simple: to avoid maintaining these critical files on each machine individually by storing them on a central server.

Advantages of NIS

  • Simplified system administration
  • Centralized updates of user information
  • Reduced errors and duplication
  • Fast deployment in large networks

⚠️ Limitations and Security

NIS is not encrypted, which can be a security concern in an unprotected network.
This is why it is now mostly replaced by LDAP, a more modern and secure solution.

📁 NFS: Sharing Files Across the Network

What is NFS ?

The Network File System is a protocol that allows a machine to access a remote folder as if it were a local directory.
In practice, NFS allows you to :

  • share files between servers
  • centralize data
  • create collaborative workspaces
  • automatically mount remote directories

🎯 Advantages of NFS

  • Centralized data management
  • Saves disk space and simplifies administration
  • Compatible with most Linux distributions
  • Widely used in virtualization and server environments

⚠️ Limitations

  • Depends on network availability
  • Security must be strengthened (authentication, firewall, Kerberos)
  • Performance varies based on network load

🔗 Using NIS & NFS Together: An Effective Combination

In many Unix/Linux architectures, NIS and NFS are used together :

  • NIS manages user and group accounts
  • NFS stores home directories on a central server

As a result, a user can log in to any machine on the network and find their personal environment.
This setup is still common in educational, research, or traditional Unix environments.

Configuring NIS and NFS on Proxmox LXC

This guide describes how to set up a centralized authentication and file-sharing environment using NIS and NFS inside LXC containers on Proxmox.

Prérequisities

The infrastructure consists of two LXC containers :

  • Server Container: hosts the NIS and NFS services
  • Client Container: authenticates via NIS and mounts directories via NFS

Configuring Proxmox Containers

Unprivileged LXC containers cannot run NFS by default. You must either use a privileged container or add the necessary capabilities.

Option 1: Privileged Container (recommended)

On the Proxmox host, edit the container’s configuration file:
nano /etc/pve/lxc/<ID_conteneur>.conf

Add or modify :
unprivileged : 0
Restart the container afterward.

Configuring the NIS Server

Installation

apt update
apt install nis

During installation

Set a NIS domain name (for example : mondomaine.local)

Domain configuration

Set the NIS domain :
domainname mondomaine.local
echo “mondomaine.local” > /etc/defaultdomain

To make the domain persistent, add the following to /etc/hosts :

127.0.0.1 localhost
<SERVER_IP> server.mydomain.local server

Master Server Configuration

Édit /etc/default/nis
Add this line :
NISSERVER=master

Initialize the NIS database :

/usr/lib/yp/ypinit -m
Confirm the server name and validate.

Starting the Services

systemctl enable rpcbind ypserv yppasswdd ypxfrd
systemctl start rpcbind ypserv yppasswdd ypxfrd

Vérification

systemctl status ypserv
ypwhich

Configuring the NFS Server

Installation

apt install nfs-kernel-server
If systemctl status nfs-kernel-server shows inactive (dead) :

  • Go to the container’s Options → Features
  • Enable the first four options
  • Restart the service

Export Configuration

Create or édit /etc/exports :
/home *(rw,sync,no_subtree_check)

Parameters :

  • rw : read/write access
  • sync : writes are synchronized immediately
  • no_subtree_check : improves reliability

Apply exports

exportfs -ra
exportfs -v

Verify :

systemctl status nfs-server

Configuring the Client

Install Packages

apt update
apt install nis nfs-common

NIS Configuration

Edit /etc/default/nis :
NISSERVER=false
NISCLIENT=true

NSS (Name Service Switch) Configuration

Edit /etc/nsswitch.conf and add nis:
passwd: files nis
group: files nis
shadow: files nis
hosts: files dns nis

Start NIS Client

systemctl enable rpcbind ypbind
systemctl start rpcbind ypbind

NIS Authentication Verification

ypwhich
ypcat passwd
getent passwd

You should see the NIS users.

NFS Mount

On the client :
mount -t nfs :/home /home

Verifiy :

df -h | grep nfs
ls -la /home

Automatic Mount at Boot

Edit /etc/fstab :
<SERVER_IP>:/home /home nfs defaults 0 0

User Management

Creating a User

On the server :
useradd -m -s /bin/bash test
passwd test

Update the NIS database:

cd /var/yp
make
systemctl restart ypserv

Update NFS exports :

exportfs -ra

On the client :

systemctl restart ypbind

Now, logging in as test should give the user their own home directory, and changes made there should appear on the server.

📝 Conclusion

NIS and NFS are two long-standing but powerful technologies for managing authentication and file sharing in Unix/Linux networks.

  • NIS simplifies user administration
  • NFS optimizes file sharing and centralization

Even though modern alternatives exist, their simplicity and effectiveness still make them reliable tools for many systems.