1080*80 ad

LHB Linux Digest #25.33: Networking, Projects, and Distributed Filesystems

Mastering Modern Linux: Essential Tools and Security Practices for Today’s Administrator

The Linux ecosystem is in a constant state of evolution. The tools and best practices that were standard a decade ago are now being replaced by more powerful, efficient, and secure alternatives. For system administrators and power users alike, staying current is not just an advantage—it’s a necessity.

This guide covers critical updates in Linux networking, process management, and distributed storage, along with a fundamental security measure every administrator must implement.


Embrace the Future of Linux Networking: Why ip Replaces ifconfig

For years, ifconfig was the go-to command for network interface configuration. However, it is now considered a legacy tool. The modern, more powerful replacement is the ip command, part of the iproute2 suite. If you are still using ifconfig, it’s time to make the switch.

The iproute2 suite is actively maintained and provides a more consistent and extensive set of functionalities for managing modern network stacks, including routing, tunnels, and complex interface configurations.

Key advantages of the ip command include:

  • Unified Syntax: It consolidates the functionality of several older tools (ifconfig, route, arp) into one command with a coherent structure.
  • More Information: It provides more detailed output, including support for multiple IPv4 and IPv6 addresses per interface.
  • Active Development: Unlike the deprecated net-tools package (which contains ifconfig), iproute2 is continuously updated to support new kernel features.

Here is a quick reference for transitioning from old commands to new ones:

| Old Command (ifconfig, route) | Modern Command (ip) |
| ——————————————————- | ——————————————————– |
| ifconfig | ip addr show or ip a |
| ifconfig eth0 up | ip link set eth0 up |
| ifconfig eth0 192.168.1.100/24 | ip addr add 192.168.1.100/24 dev eth0 |
| route -n | ip route show or ip r |

Making the ip command a part of your daily workflow is a crucial step in modernizing your Linux administration skills.


Beyond top: A Better Way to Monitor System Processes with htop

The top command provides a real-time view of running processes, but its interface can be clunky. Enter htop, an interactive process viewer that offers a significant upgrade in usability and features. It presents information in a clearer, color-coded format that is easier to read and interpret at a glance.

Why htop is superior to top:

  • User-Friendly Interface: htop allows you to scroll vertically and horizontally, so you can see the full command lines of processes and view all processes without the list being truncated.
  • Interactive Process Management: You can directly interact with processes using function keys. For instance, you can kill a process (F9), change its priority/nice value (F7, F8), or filter the list by user.
  • Visual Enhancements: The color-coded display for CPU, memory, and swap usage makes it easy to quickly assess system health.
  • Tree View: A simple keypress (F5) toggles a tree view, clearly showing the parent-child relationships between processes, which is incredibly useful for debugging.

Getting started with htop is simple. On most distributions, it can be installed with a single command:
sudo apt install htop (for Debian/Ubuntu) or sudo yum install htop (for CentOS/RHEL).


Understanding Ceph: The Future of Distributed Storage

As data needs grow, traditional storage solutions often fall short. Ceph is a powerful, open-source, software-defined storage platform designed for excellent performance, reliability, and massive scalability. It is a unified system that provides object, block, and file storage from a single distributed cluster.

At its core, Ceph is built for resilience. Its architecture has no single point of failure, meaning the failure of an individual server or drive won’t bring down your storage system.

Key features that make Ceph a game-changer:

  • Self-Healing and Self-Managing: Ceph automatically detects and recovers from faults. If a drive fails, it re-replicates the data to other drives in the cluster to maintain the desired level of redundancy.
  • Massive Scalability: Ceph clusters can scale from a few servers to thousands, managing exabytes of data without a corresponding increase in administrative overhead.
  • Intelligent Data Placement: Instead of relying on a central metadata server (which can become a bottleneck), Ceph uses an algorithm called CRUSH (Controlled Replication Under Scalable Hashing) to dynamically calculate where data should be stored and retrieved. This allows the cluster to scale and rebalance itself efficiently.

Ceph is the storage backbone for many cloud platforms, including OpenStack, and is an ideal solution for big data analytics, high-performance computing, and any application requiring a robust and scalable storage foundation.


A Critical Security Step: Why You Must Disable Root SSH Login

One of the most important security hardening practices for any internet-facing Linux server is to disable direct root login via SSH. The root user is a default, well-known username, making it the primary target for automated brute-force attacks from malicious actors around the globe.

Allowing direct root login is like leaving the front door of your house unlocked. The best practice is to log in with a non-privileged user account and then escalate privileges using sudo when administrative tasks are required. This approach provides a clear audit trail and significantly reduces your server’s attack surface.

Here’s how to disable root SSH login:

  1. Open the SSH daemon configuration file with a text editor like nano or vim:

    sudo nano /etc/ssh/sshd_config
    
  2. Find the line that contains PermitRootLogin. It may be commented out with a # and set to yes.

  3. Change the value to no. Make sure to uncomment the line by removing the # if present:

    PermitRootLogin no
    
  4. Save the file and exit the editor.

  5. Restart the SSH service for the change to take effect:
    bash
    sudo systemctl restart sshd

IMPORTANT: Before you perform these steps, you must ensure you have another user account with sudo privileges. If you disable root login without having an alternative administrative user, you will be locked out of your server. Always test that you can log in with your sudo-enabled user and successfully run sudo su - before logging out of your root session.

Source: https://linuxhandbook.com/newsletter/25-33/

900*80 ad

      1080*80 ad