NIS Setup (Rocky Linux 8)

This guide outlines the steps to set up a basic and functional Network Information

InfrastructureSecurityNetworkingEnterprise
NIS Setup (Rocky Linux 8)

This guide is for Rocky Linux 8. If you are using a different version of Linux, the steps may vary.

Overview

Setting up a Linux server cluster often requires central authentication systems, including options like LDAP and NIS. In this guide, we focus on using NIS (Network Information Service) to manage user authentication and ensure seamless integration across nodes. This guide provides comprehensive, step-by-step instructions for establishing a robust and functional NIS configuration. By centralizing user authentication across multiple Linux servers, NIS reduces administrative overhead and facilitates seamless integration of distributed systems, including password-less SSH logins.

Architecture

Network Information Service (NIS) is a client-server directory service protocol designed to distribute system configuration files—such as user accounts, groups, and hostnames—across a network. Below is an overview of the NIS architecture:

NIS Architecture
NIS Architecture

Key NIS Maps

Map NameDescription
passwd.bynameUser account information by username
passwd.byuidUser account information by UID
group.bynameGroup information by group name
group.bygidGroup information by GID
hosts.bynameHostname-to-IP mapping
hosts.byaddrIP-to-hostname mapping

These maps form the core of NIS functionality, providing structured access to user and host data for network-wide consistency.

Server-Side Configuration

  1. Install Necessary Packages:

    Install the required components for NIS server functionality.

    bash
  2. Set NIS Domain Name:

    Define a unique domain name for your NIS setup.

    bash
  3. Allow All Hosts, Users, and Groups:

    Configure NIS to permit unrestricted access. Adjust this for stricter security in production.

    bash
    Quote

    Warning: This configuration allows unrestricted access to all hosts, users, and groups, which may pose security risks. For production environments, consider defining stricter access control policies to limit exposure.

  4. Enable and Start Services:

    Activate the necessary services to run the NIS server.

    bash
  5. Initialize NIS Maps:

    Generate the initial NIS maps, which include user and group data.

    bash
  6. Update NIS Maps After Adding Users:

    Refresh the maps whenever changes are made to user or group data.

    bash
  7. Optional: Configure SELinux:

    Adjust SELinux policies to accommodate NIS functionality.

    bash
  8. Configure Firewall:

Firewall configuration is a critical step to ensure the security of your NIS setup. It controls the network traffic that can access your server and prevents unauthorized access. Consider performing this step before enabling services to avoid exposing your system during configuration.

  • Edit /etc/sysconfig/network:

    bash
  • Edit /etc/sysconfig/yppasswdd:

    bash
  • Restart Services:

    bash
  • Configure Firewall:

    bash

Client-Side Configuration

  1. Install Necessary Packages:

    Install the required components for the NIS client.

    bash
  2. Set NIS Domain Name:

    Define the NIS domain for the client system.

    bash
  3. Configure NIS Client:

    Set up the client to connect to the NIS server.

    • Edit /etc/yp.conf:

      bash
  4. Enable and Start Services:

    Activate the services required for NIS client functionality.

    bash
  5. Configure Authentication:

    bash

    This command configures the system to use NIS for authentication by updating the PAM (Pluggable Authentication Module) stack. It ensures that users authenticated via the NIS server can access the system. This step is crucial for enabling centralized authentication in an NIS environment.

    • To create home directories on initial login:

      bash
  6. Optional: Configure SELinux:

    Adjust SELinux policies to support NIS client operations.

    bash
  7. Verify NIS Server Binding:

    Check which NIS server the client is connected to.

    bash
    • Expected output:

      plaintext
  8. Change NIS Password:

    Update the NIS password for a user.

    bash

Conclusion

By following this guide, you can successfully set up and configure NIS on both the server and client sides. This setup centralizes user management, simplifies authentication across multiple systems, and reduces administrative overhead. For production environments, always review security settings to ensure compliance with organizational policies and best practices. If you encounter issues, consult the system logs, verify service statuses, or check network configurations to identify potential misconfigurations. With proper setup and maintenance, NIS can significantly streamline system administration and improve operational efficiency.

Recommended Posts

Responses (0)

No comments yet. Be the first to share your thoughts!