Skip to content
Go back

RHEL Intensive – Network, User, and System Administration: A Beginner’s Guide

Edit page

🎯 New to RHEL or Linux system administration? This guide breaks down networking, user management, and system admin tasks into easy-to-follow steps with plenty of theory to build your confidence. Whether you’re setting up a server or managing users, we’ve got you covered with clear examples and tips!


Linux Server

⚠️ Before starting, make sure to first read: RHEL Linux Fundamentals

Table of Contents

Open Table of Contents

🌐 Configuring Networking in RHEL

Networking is the backbone of any server. In RHEL, setting up and managing network interfaces is crucial for connecting to the internet or other devices. Let’s start with the basics.

Why Networking Matters: Your server needs an IP address (like a house address) to talk to other machines. You’ll also need to configure gateways (like a front door to the internet) and DNS (like a phonebook to find websites).

Key Commands for Network Setup

  1. Check Network Hardware: Use lspci -vvv to list all PCI devices, including network cards. It’s like checking what network hardware is plugged in.

    lspci -vvv
  2. Inspect Interface Settings: ethtool eth0 shows details like connection speed or whether the link is up.

    ethtool eth0
  3. Set a Static IP: Edit /etc/sysconfig/network-scripts/ifcfg-eth0 to assign a fixed IP address.

    nano /etc/sysconfig/network-scripts/ifcfg-eth0

    Example content:

    DEVICE=eth0
    BOOTPROTO=static
    IPADDR=192.168.1.10
    NETMASK=255.255.255.0
    GATEWAY=192.168.1.1
    ONBOOT=yes
  4. Apply Changes: Restart the network service to use the new settings.

    service network restart

Beginner Tip: Always back up config files before editing. A typo can disconnect your server! Use ip addr to verify the IP after restarting.


🚪 Routing Basics

Routing tells your system how to send data to other networks. Think of it as giving directions to a delivery driver.

Key Commands

  1. Add a Default Gateway: This is your server’s “exit” to the internet.

    route add default gw 192.168.1.1
  2. View Routing Table: route -n shows where data goes (numerical format for clarity).

    route -n

    Example output:

    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
    0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 eth0
  3. Enable/Disable Interfaces:

    • Turn off: ifconfig eth1 down or ifdown eth1
    • Turn on: ifconfig eth1 up or ifup eth1

Theory: Routes define paths for data packets. The default gateway (0.0.0.0) handles traffic to unknown destinations. Use ifconfig or ip commands for quick changes, but config files for persistence.

Beginner Hack: Use ip route instead of route for modern systems—it’s more detailed. Test connectivity with ping 8.8.8.8.


📡 DNS and CIDR

DNS Configuration (/etc/resolv.conf)

DNS translates domain names (like google.com) to IP addresses. The /etc/resolv.conf file tells your system which DNS servers to use.

Example:

nameserver 8.8.8.8
nameserver 8.8.4.4
search example.com
options timeout:2

Tip: If /etc/resolv.conf gets overwritten, check NetworkManager or DHCP settings.

CIDR (Classless Inter-Domain Routing)

CIDR is a way to define IP address ranges. It’s written as IP/prefix, like 192.168.1.0/24, where /24 means 24 bits for the network, leaving 8 bits for hosts (254 usable IPs).

Common CIDR Ranges:

CIDRSubnet MaskUsable Hosts
/24255.255.255.0254
/30255.255.255.2522
/16255.255.0.065,534

Example: Assign an IP with CIDR:

ip addr add 192.168.1.100/24 dev eth0

Why CIDR? It’s more flexible than old class-based networking, saving IP addresses for efficiency.


🔗 IP Aliasing

IP aliasing lets one network interface have multiple IP addresses. It’s like giving your server multiple phone numbers.

Use Cases:

Example:

sudo ip addr add 192.168.1.100/24 dev eth0
sudo ip addr del 192.168.1.100/24 dev eth0  # Remove it

Tip for Beginners: Check IPs with ip addr show. Be cautious with aliases in production—track them to avoid conflicts.


🔌 Common Ports

Ports are like doors for network services. Each service uses a specific port number.

Well-Known Ports (0–1023):

PortServiceProtocolDescription
22SSHTCPSecure remote login
80HTTPTCPWeb traffic
443HTTPSTCPSecure web traffic
53DNSTCP/UDPName resolution
25SMTPTCPEmail sending

Dynamic Ports (1024–49151): Used for temporary connections (e.g., MySQL on 3306, PostgreSQL on 5432).

Registered Ports (49152–65535): For custom or private apps.

Check Ports: View services with less /etc/services.

Beginner Tip: Use netstat -tuln to see which ports are open. Never expose sensitive ports (e.g., 22) to the public without a firewall.


🔍 Network Monitoring Tools

Keep an eye on your network to troubleshoot or spot issues.

  1. netstat: Shows connections and ports.

    sudo netstat -tulnp
  2. pidof: Finds process IDs (e.g., pidof sshd).

  3. ping: Tests connectivity.

    ping -c 4 8.8.8.8
  4. tcpdump: Captures packets for analysis.

    sudo tcpdump -i eth0 port 80

Theory: Monitoring helps detect slow connections, unauthorized access, or network overloads. Tools like tcpdump are advanced but great for debugging.

Beginner Hack: Start with ping to test internet, then netstat to check services. Save tcpdump output to a file for later analysis.


📦 Package Management (.rpm and .deb)

RHEL uses .rpm packages, managed by rpm or yum/dnf. Debian-based systems use .deb with dpkg or apt.

RPM Commands

YUM Commands

DEB Commands

Theory: Package managers handle dependencies (other software needed). YUM/DNF and APT are higher-level, resolving dependencies automatically.

Tip: Prefer yum over rpm for RHEL to avoid dependency headaches. Use alien to convert between .rpm and .deb if needed.


💾 Swap Space Management

Swap is like a backup for RAM, storing data when memory is full.

Why Swap? Prevents crashes during memory spikes, especially on low-RAM systems.

Commands:

Find Swap Users:

cat /proc/<pid>/status | grep -i swap

Beginner Tip: Keep swap at 1-2x RAM size for small systems. Monitor with free -h.


📊 Monitoring with top

top shows live system stats—CPU, memory, processes.

Key Shortcuts:

Theory: top helps spot resource hogs. Combine with htop for a prettier view.

Tip: Press q to quit top. Use top -b > log.txt for logs.


🔎 File Searching with find

The find command is your file-hunting tool.

Examples:

Theory: find searches recursively, filtering by name, type, size, or time. Use cautiously with -exec to avoid accidental deletes.

Beginner Tip: Start with find . -name "pattern" in your current directory to avoid searching the whole system.


⚙️ Process Management

Processes are running programs. Manage them to keep your system healthy.

Tools:

Process States:

Theory: Zombies waste resources. Use ps or top to find and fix them.

Tip: Use pkill -u username to stop all user processes safely.


🔍 Hardware Info with dmidecode

dmidecode reads hardware details from BIOS/UEFI.

Examples:

Theory: Great for inventory or troubleshooting hardware issues.

Tip: Run with sudo for full details. Use in scripts for automation.


🖨️ Printers and Tape Drives

Theory: Device files like /dev/lp0 treat hardware as files, a Linux hallmark.

Tip: Rarely used today, but handy for legacy systems.


💾 Mounting ISOs and /dev/null

Theory: Loop mounting treats files as devices. /dev/null is a “black hole” for unwanted output.

Tip: Use /dev/null in scripts to silence noisy commands.


📦 YUM Package Manager

YUM manages .rpm packages with ease.

Key Commands:

Theory: YUM resolves dependencies, unlike raw rpm. It’s RHEL’s go-to for software management.

Tip: Run yum clean all if updates fail.


🗄️ Configuring a YUM Local Repository

Set up a local repo for offline package installs.

Steps:

  1. Create directory: mkdir /repo/local
  2. Add .rpm files.
  3. Generate metadata: createrepo /repo/local
  4. Create repo file: /etc/yum.repos.d/local.repo
    [localrepo]
    name=Local YUM Repository
    baseurl=file:///repo/local
    enabled=1
    gpgcheck=0
  5. Update cache: yum clean all; yum repolist

Theory: Local repos save bandwidth and work offline.

Tip: Use for air-gapped servers or custom software.


🔄 Rsync for File Syncing

rsync syncs files efficiently, copying only changes.

Example:

rsync -parv /home/docs/ /backup/

Theory: Rsync uses deltas for speed, ideal for backups.

Tip: Test with --dry-run to preview.


💾 Logical Volume Management (LVM)

LVM makes storage flexible, allowing resizing without downtime.

Steps:

  1. pvcreate /dev/sdb
  2. vgcreate my_vg /dev/sdb
  3. lvcreate -L 5G -n my_lv my_vg
  4. mkfs.ext4 /dev/my_vg/my_lv
  5. Mount: mount /dev/my_vg/my_lv /mnt

Theory: LVM abstracts physical disks into logical volumes for easy management.

Tip: Use lvresize to grow/shrink volumes.


⏰ Scheduling Tasks with Cron and at

Automate tasks with cron (recurring) or at (one-time).

Cron:

at:

Theory: Cron is for routines, at for one-offs. Control access with /etc/cron.allow or at.deny.

Tip: Use https://crontab.guru for cron schedules.


👤 User Management

Manage users to control access and security.

Commands:

Key Files:

Theory: Users and groups organize access. /etc/login.defs sets defaults.

Tip: Use adduser for simplicity; useradd for scripts.


🔐 Advanced Permissions

Fine-tune access with SUID, SGID, Sticky Bit, sudoers, and setfacl.

Theory: These extend basic permissions for complex scenarios.

Tip: Test setfacl on non-critical files first.


⚙️ Kernel and Driver Management

Manage kernel modules (drivers) for hardware.

Commands:

Kernel Tuning:

Theory: Modules add functionality to the kernel. Tuning optimizes performance.

Tip: Use modinfo to check module details before loading.


🧭 What’s Next?

You’re now equipped to handle networking, users, and admin tasks on RHEL! Practice in a VM, explore tools like firewalld for security, or dive into scripting for automation. Got questions? Leave a comment, and keep exploring Linux—it’s a journey!


Edit page
Share this post on:

Previous Post
RHEL Intensive - Services: AWS, Networking, FTP, Apache, Firewalls, SELinux, and Samba
Next Post
RHEL Intensive – Linux Fundamentals A Beginner-Friendly Guide