<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mayank Malakar on Medium]]></title>
        <description><![CDATA[Stories by Mayank Malakar on Medium]]></description>
        <link>https://medium.com/@mayankmalakar.2006?source=rss-6f0c638f64b2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*79TRVDAlmybaENew</url>
            <title>Stories by Mayank Malakar on Medium</title>
            <link>https://medium.com/@mayankmalakar.2006?source=rss-6f0c638f64b2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 23:12:28 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mayankmalakar.2006/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Container Management in RHEL: Deploy, Run, and Manage Containers Using Podman]]></title>
            <link>https://medium.com/@mayankmalakar.2006/container-management-in-rhel-deploy-run-and-manage-containers-using-podman-8db6f53cb2ce?source=rss-6f0c638f64b2------2</link>
            <guid isPermaLink="false">https://medium.com/p/8db6f53cb2ce</guid>
            <dc:creator><![CDATA[Mayank Malakar]]></dc:creator>
            <pubDate>Mon, 02 Nov 2026 12:55:34 GMT</pubDate>
            <atom:updated>2026-11-02T12:55:34.304Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TZadz8u9Ivllj7UmNJQF0w.png" /></figure><h3>Introduction to Containers:</h3><p>Containers are lightweight, isolated environments used to run applications and services. Unlike virtual machines, containers share the host operating system’s kernel while keeping application processes, files, and dependencies isolated.</p><p>Containers are useful because they are portable, lightweight, and quick to deploy. An application packaged in a container can run consistently across different environments, provided the required container runtime and compatible system resources are available.</p><p>In Red Hat Enterprise Linux (RHEL), <strong>Podman</strong> is a container management tool used to create, run, inspect, and manage containers.</p><p>Podman is daemonless, meaning it does not require a continuously running central daemon to manage containers. It also supports rootless containers, allowing users to run containers without root privileges.</p><h3>Container Concepts:</h3><p>Understanding the following terms is essential before working with containers.</p><p><strong>Container Image:</strong><br>A read-only template containing an application, its dependencies, and the required filesystem. Images are used to create containers.</p><p><strong>Container:</strong><br>A running or stopped instance of a container image. A container provides an isolated environment for an application.</p><p><strong>Container Registry:</strong><br>A repository used to store and distribute container images. Examples include Red Hat’s registry, Docker Hub, and Quay.io.</p><p><strong>Container Runtime:</strong><br>The software responsible for running containers. Podman provides commands to manage containers and uses lower-level container technologies to execute them.</p><p><strong>Persistent Storage:</strong><br>Storage that exists outside the container’s writable layer. It allows application data to remain available even if the container is removed or recreated.</p><p><strong>Container Networking:</strong><br>The mechanism that allows containers to communicate with the host, other containers, and external networks.</p><h3>Steps to Create and Run a Container Using Podman</h3><p>The following example demonstrates how to deploy an Nginx web server container on RHEL.</p><h3>Step 1: Check Podman Installation</h3><p>Verify whether Podman is installed on the system.</p><pre>podman --version</pre><p>If Podman is not installed, install it using:</p><pre>sudo dnf install podman -y</pre><p><strong>Explanation:</strong><br>The dnf package manager installs Podman and its required dependencies.</p><h3>Step 2: Search for a Container Image</h3><p>Search for an Nginx image in available container registries.</p><pre>podman search nginx</pre><p><strong>Explanation:</strong><br>The podman search command searches registries for container images. Review the image name and registry before pulling an image.</p><h3>Step 3: Download the Container Image</h3><p>Download the Nginx image from a registry.</p><pre>podman pull docker.io/library/nginx</pre><p><strong>Explanation:</strong><br>The podman pull command downloads a container image to the local system. The image is stored locally and can be used to create containers.</p><h3>Step 4: List Available Images</h3><p>Check the images downloaded to the system.</p><pre>podman images</pre><p><strong>Explanation:</strong><br>This command displays locally available images, including their repository, tag, image ID, and size.</p><h3>Step 5: Create and Run a Container</h3><p>Create and start a container using the downloaded Nginx image.</p><pre>podman run -d --name webserver -p 8080:80 nginx</pre><p><strong>Explanation of options:</strong></p><ul><li>podman run — Creates and starts a container.</li><li>-d — Runs the container in the background.</li><li>--name webserver — Assigns the container the name webserver.</li><li>-p 8080:80 — Maps host port 8080 to container port 80.</li><li>nginx — Specifies the container image.</li></ul><p>The Nginx web server listens on port 80 inside the container. Port mapping makes it accessible through port 8080 on the host.</p><h3>Step 6: Verify the Running Container</h3><p>List currently running containers.</p><pre>podman ps</pre><p>To display all containers, including stopped ones:</p><pre>podman ps -a</pre><p><strong>Explanation:</strong><br>The podman ps command displays running containers. The -a option displays all containers, regardless of their state.</p><h3>Step 7: Access the Container</h3><p>Open a shell inside the running container.</p><pre>podman exec -it webserver /bin/sh</pre><p><strong>Explanation:</strong></p><ul><li>podman exec — Executes a command inside an existing container.</li><li>-it — Provides an interactive terminal.</li><li>webserver — Specifies the container name.</li><li>/bin/sh — Starts a shell inside the container.</li></ul><p>To exit the container shell:</p><pre>exit</pre><h3>Step 8: Test the Nginx Web Server</h3><p>From the container host, run:</p><pre>curl http://localhost:8080</pre><p><strong>Explanation:</strong><br>The command sends an HTTP request to the host’s port 8080. If Nginx is running correctly, its default web page response should be displayed.</p><h3>Step 9: View Container Logs</h3><p>Check the logs generated by the container.</p><pre>podman logs webserver</pre><p>To follow the logs continuously:</p><pre>podman logs -f webserver</pre><p><strong>Explanation:</strong><br>Container logs help administrators monitor application output and troubleshoot problems.</p><h3>Step 10: Stop, Start, and Remove the Container</h3><p>Stop the running container:</p><pre>podman stop webserver</pre><p>Start the stopped container:</p><pre>podman start webserver</pre><p>Restart the container:</p><pre>podman restart webserver</pre><p>Remove the container:</p><pre>podman rm webserver</pre><p><strong>Explanation:</strong><br>Stopping a container does not remove it. The container can be started again using podman start. To remove a container, it must first be stopped.</p><p>To forcefully remove a running container:</p><pre>podman rm -f webserver</pre><h3>Container Storage and Persistent Data</h3><p>By default, data written inside a container may be stored in its writable layer. This data can be lost when the container is removed.</p><p>To preserve data, administrators can use a bind mount to share a directory from the host with the container.</p><p>Create a host directory:</p><pre>sudo mkdir -p /container-data</pre><p>Run a container with persistent storage:</p><pre>podman run -d \<br>  --name webserver \<br>  -p 8080:80 \<br>  -v /container-data:/usr/share/nginx/html:Z \<br>  nginx</pre><p><strong>Explanation:</strong></p><ul><li>/container-data — Directory on the container host.</li><li>/usr/share/nginx/html — Nginx web content directory inside the container.</li><li>-v — Mounts the host directory into the container.</li><li>:Z — Applies a private SELinux label suitable for the container.</li></ul><p>Files placed in the host directory can be accessed by the container through the mounted directory. This allows data to persist even if the container is removed.</p><h3>Important Podman Commands</h3><pre>podman search nginx<br>podman pull nginx<br>podman images<br>podman run -d --name webserver -p 8080:80 nginx<br>podman ps<br>podman ps -a<br>podman inspect webserver<br>podman logs webserver<br>podman exec -it webserver /bin/sh<br>podman stop webserver<br>podman start webserver<br>podman restart webserver<br>podman rm webserver<br>podman rmi nginx</pre><h3>Conclusion:</h3><p>Podman is an important container management tool in Red Hat Enterprise Linux. It allows administrators to download images, create containers, deploy applications, manage storage and networking, and monitor container activity.</p><p>Understanding the complete container lifecycle — from pulling an image to running, inspecting, stopping, and removing a container — is an essential system administration skill and an important part of practical RHCSA preparation.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8db6f53cb2ce" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Linux Network Troubleshooting: Ping, nslookup, netstat & TCP/UDP]]></title>
            <link>https://medium.com/@mayankmalakar.2006/linux-network-troubleshooting-ping-nslookup-netstat-tcp-udp-e339b87dd4e3?source=rss-6f0c638f64b2------2</link>
            <guid isPermaLink="false">https://medium.com/p/e339b87dd4e3</guid>
            <dc:creator><![CDATA[Mayank Malakar]]></dc:creator>
            <pubDate>Mon, 02 Nov 2026 12:55:16 GMT</pubDate>
            <atom:updated>2026-11-02T12:55:16.961Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ze267L0Tti3pzoYOFQtpBA.png" /></figure><p>Networking is a fundamental component of Linux system administration and cybersecurity. Understanding how systems communicate, resolve domain names, and establish network connections is essential for troubleshooting connectivity issues and monitoring network services.</p><p>In this guide, I explore four essential networking topics:</p><ul><li><strong>Ping:</strong> Testing network connectivity.</li><li><strong>nslookup:</strong> Investigating DNS resolution.</li><li><strong>netstat:</strong> Inspecting network connections and listening ports.</li><li><strong>TCP and UDP:</strong> Understanding transport-layer communication.</li></ul><h3>1. Ping — Testing Network Connectivity</h3><p>The ping command is used to test whether a destination is reachable over a network.</p><p>It sends ICMP Echo Request packets and waits for ICMP Echo Reply packets from the destination.</p><h3>Main Command</h3><pre>ping google.com</pre><h3>Useful Commands</h3><pre># Send four packets to an IP address<br>ping -c 4 8.8.8.8</pre><pre># Test connectivity using a hostname<br>ping -c 4 google.com</pre><pre># Set a two-second interval between packets<br>ping -i 2 192.168.1.1</pre><h3>Understanding the Output</h3><pre>64 bytes from 8.8.8.8: icmp_seq=1 ttl=117 time=20.5 ms</pre><ul><li>icmp_seq — Sequence number of the packet.</li><li>ttl — Time To Live value of the received packet.</li><li>time — Round-trip time in milliseconds.</li></ul><h3>Use Cases</h3><ul><li>Verify connectivity between systems.</li><li>Test whether a default gateway is reachable.</li><li>Identify packet loss and network latency.</li><li>Perform basic network troubleshooting.</li></ul><p><strong>Important:</strong> A failed ping does not necessarily mean that the destination is offline. ICMP traffic may be blocked by a firewall or network policy.</p><h3>2. nslookup — DNS Name Resolution</h3><p>The nslookup command is used to query DNS servers and retrieve information about domain names.</p><p>The Domain Name System (DNS) translates domain names into IP addresses, allowing systems to communicate using names instead of numerical addresses.</p><h3>Main Command</h3><pre>nslookup google.com</pre><h3>Example Output</h3><pre>Server:  192.168.1.1<br>Address: 192.168.1.1#53</pre><pre>Non-authoritative answer:<br>Name:    google.com<br>Address: 142.250.183.14</pre><h3>Understanding the Output</h3><ul><li>Server — The DNS server being queried.</li><li>Address — The IP address of the DNS server.</li><li>#53 — The DNS port.</li><li>Non-authoritative answer — The responding server is not authoritative for the queried domain.</li></ul><p>The DNS server displayed may be your router, ISP resolver, or a public DNS resolver.</p><p>It is not necessarily the nearest DNS server or the authoritative server for the domain.</p><h3>Useful Commands</h3><p><strong>Query a Specific DNS Server</strong></p><pre>nslookup google.com 8.8.8.8</pre><p>This sends the DNS query to Google’s public DNS resolver.</p><p><strong>Find Name Servers (NS Records)</strong></p><pre>nslookup -type=NS example.com</pre><p>This retrieves the name server records associated with the domain.</p><p><strong>Find Mail Servers (MX Records)</strong></p><pre>nslookup -type=MX example.com</pre><p>This retrieves the mail exchange records used by the domain.</p><h3>Use Cases</h3><ul><li>Troubleshoot DNS resolution failures.</li><li>Identify the DNS resolver used by your system.</li><li>Query different DNS servers.</li><li>Inspect DNS records such as NS and MX.</li></ul><p><strong>Key Concept:</strong> DNS resolution and network connectivity are different. A system may have working network connectivity but still experience DNS resolution failures.</p><h3>3. netstat — Inspecting Network Connections and Listening Ports</h3><p>The netstat command is a network utility used to display network connections, listening ports, routing tables, and network statistics.</p><p>It helps administrators identify active connections, inspect listening services, and investigate network-related issues.</p><h3>Main Command</h3><pre>netstat -tulnp</pre><h3>Understanding the Options</h3><ul><li>-t — Display TCP connections.</li><li>-u — Display UDP sockets.</li><li>-l — Display listening sockets.</li><li>-n — Display numerical IP addresses and port numbers.</li><li>-p — Display the associated process ID and program name, when available.</li></ul><h3>Example Output</h3><pre>Proto  Local Address       Foreign Address     State       PID/Program<br>tcp    0.0.0.0:22          0.0.0.0:*           LISTEN      1234/sshd<br>tcp    0.0.0.0:80          0.0.0.0:*           LISTEN      2345/httpd</pre><h3>Understanding the Output</h3><p><strong>Local Address</strong></p><p>The local IP address and port on which the service is listening.</p><p><strong>Foreign Address</strong></p><p>The remote endpoint associated with the connection.</p><p><strong>State</strong></p><p>The current state of a TCP connection.</p><p>Common TCP states include:</p><ul><li>LISTEN — Waiting for incoming connections.</li><li>ESTABLISHED — An active TCP connection has been established.</li><li>TIME_WAIT — A closed TCP connection is waiting before final cleanup.</li></ul><p><strong>PID/Program</strong></p><p>Identifies the process associated with the socket, when process information is available.</p><h3>Useful Commands</h3><p><strong>Display Listening TCP Ports</strong></p><pre>netstat -tlpn</pre><p><strong>Display Active TCP Connections</strong></p><pre>netstat -tn</pre><p><strong>Display Network Statistics</strong></p><pre>netstat -s</pre><p><strong>Display the Routing Table</strong></p><pre>netstat -rn</pre><h3>Modern Alternative: ss</h3><p>On modern Linux systems, ss is generally preferred over netstat.</p><pre>ss -tulnp</pre><p>The ss command provides similar socket information and is commonly available on RHEL systems.</p><p><strong>Use Cases:</strong></p><ul><li>Identify services listening on network ports.</li><li>Investigate unexpected network connections.</li><li>Check whether a service is accepting connections.</li><li>Identify processes associated with network sockets.</li><li>Troubleshoot port conflicts.</li></ul><p><strong>Note:</strong> The netstat utility is provided by the net-tools package. If it is unavailable on RHEL, use ss or install the required package where permitted.</p><h3>4. TCP and UDP — Understanding Transport-Layer Protocols</h3><p>TCP and UDP are transport-layer protocols used for communication between applications over IP networks.</p><p>They use port numbers to identify the applications or services involved in network communication.</p><h3>TCP — Transmission Control Protocol</h3><p>TCP is a connection-oriented protocol that provides reliable and ordered delivery of data.</p><p>Before transferring data, TCP establishes a connection using a three-way handshake.</p><h3>TCP Three-Way Handshake</h3><pre>Client                  Server<br>  |                        |<br>  |------ SYN ------------&gt;|<br>  |                        |<br>  |&lt;----- SYN-ACK ---------|<br>  |                        |<br>  |------ ACK ------------&gt;|<br>  |                        |<br>  |   Connection Ready     |</pre><p><strong>TCP Characteristics:</strong></p><ul><li>Reliable data delivery.</li><li>Ordered data transmission.</li><li>Error detection and retransmission.</li><li>Connection establishment and management.</li></ul><p><strong>Common TCP Applications:</strong></p><ul><li>HTTP and HTTPS</li><li>SSH</li><li>FTP</li><li>SMTP</li></ul><p>TCP is commonly used when reliable and ordered data delivery is required.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ze267L0Tti3pzoYOFQtpBA.png" /></figure><h3>UDP — User Datagram Protocol</h3><p>UDP is a connectionless transport protocol that sends data without establishing a connection.</p><p>Unlike TCP, UDP does not guarantee delivery, ordering, or retransmission.</p><p>It is commonly used when low latency and reduced communication overhead are important.</p><p><strong>UDP Characteristics:</strong></p><ul><li>Connectionless communication.</li><li>Lower protocol overhead.</li><li>No built-in retransmission.</li><li>No guarantee of packet delivery or ordering.</li></ul><p><strong>Common UDP Applications:</strong></p><ul><li>DNS queries</li><li>DHCP</li><li>VoIP</li><li>Online gaming</li><li>Real-time communication</li></ul><h3>TCP vs UDP — Key Differences</h3><p><strong>TCP:</strong></p><ul><li>Connection-oriented.</li><li>Provides reliable data delivery.</li><li>Maintains data ordering.</li><li>Uses acknowledgments and retransmissions.</li><li>Commonly used by HTTPS, SSH, and FTP.</li></ul><p><strong>UDP:</strong></p><ul><li>Connectionless.</li><li>Does not guarantee data delivery.</li><li>Does not guarantee data ordering.</li><li>Has lower protocol overhead.</li><li>Commonly used by DNS, DHCP, and VoIP.</li></ul><h3>Understanding Port Numbers</h3><p>A port number identifies a network service or application.</p><p>Some commonly used ports include:</p><pre>SSH       → TCP 22<br>DNS       → UDP/TCP 53<br>HTTP      → TCP 80<br>HTTPS     → TCP 443<br>DHCP      → UDP 67/68</pre><p>DNS commonly uses UDP for standard queries, but TCP is also used when required, including for some large responses and zone transfers.</p><p><strong>Key Concept:</strong> IP addresses identify network interfaces, while TCP and UDP port numbers identify application endpoints. Together, they help identify the endpoints involved in network communication.</p><h3>Essential Networking Commands Cheat Sheet</h3><pre># Test network connectivity<br>ping -c 4 8.8.8.8</pre><pre># Query DNS records<br>nslookup google.com</pre><pre># Query a specific DNS resolver<br>nslookup google.com 8.8.8.8</pre><pre># Display listening TCP and UDP sockets<br>netstat -tulnp</pre><pre># Display active TCP connections<br>netstat -tn</pre><pre># Display network statistics<br>netstat -s</pre><pre># Display the routing table<br>netstat -rn</pre><pre># Modern alternative to netstat<br>ss -tulnp</pre><h3>Conclusion</h3><p>Understanding fundamental networking commands is essential for Linux system administration and cybersecurity.</p><p>ping helps test network connectivity, nslookup investigates DNS resolution, and netstat provides visibility into network connections and listening ports.</p><p>Understanding TCP and UDP further explains how applications communicate across networks and how different services use transport-layer protocols.</p><p>Together, these concepts provide a practical foundation for network troubleshooting, service monitoring, and Linux administration.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e339b87dd4e3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Linux Networking Essentials: IP Addressing, DNS & NetworkManager]]></title>
            <link>https://medium.com/@mayankmalakar.2006/linux-networking-essentials-ip-addressing-dns-networkmanager-01526bbd7954?source=rss-6f0c638f64b2------2</link>
            <guid isPermaLink="false">https://medium.com/p/01526bbd7954</guid>
            <dc:creator><![CDATA[Mayank Malakar]]></dc:creator>
            <pubDate>Mon, 02 Nov 2026 12:54:55 GMT</pubDate>
            <atom:updated>2026-11-02T12:54:55.477Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3WT47J7UasA3XqzIcpk9ZA.png" /></figure><p>Networking is a fundamental skill in Linux system administration. Every server requires proper network configuration to communicate with other systems, access network resources, and provide services.</p><p>In Red Hat Enterprise Linux (RHEL), networking is managed primarily through <strong>NetworkManager</strong>, which provides both graphical and command-line tools.</p><p>In this guide, I cover the essential networking concepts, IP configuration, nmcli commands, hostname management, DNS resolution, and network troubleshooting.</p><h3>1. Networking Fundamentals</h3><p>Before configuring a network, understand these essential concepts:</p><ul><li><strong>IP Address:</strong> A logical address used to identify a device on a network.</li><li><strong>Subnet Mask:</strong> Defines the network and host portions of an IP address.</li><li><strong>Default Gateway:</strong> The router used to reach external networks.</li><li><strong>DNS:</strong> Translates domain names into IP addresses.</li><li><strong>DHCP:</strong> Automatically assigns IP addresses and network settings.</li><li><strong>Static IP:</strong> A manually configured IP address that remains predictable.</li></ul><p>For example:</p><pre>IP Address: 192.168.1.100<br>Subnet:     255.255.255.0 (/24)<br>Gateway:    192.168.1.1<br>DNS:        8.8.8.8</pre><h3>2. Inspecting Network Configuration</h3><p>Linux provides several commands to inspect network interfaces and connectivity.</p><pre>ip link show       # Display network interfaces<br>ip addr show       # Display assigned IP addresses<br>ip route           # Display routing table<br>nmcli device status # Display device status<br>nmcli connection show # Display connection profiles</pre><p><strong>Key Concept:</strong> A network device is the interface through which a system communicates, while a connection profile contains the configuration applied to that device.</p><h3>3. Configure Networking Using GUI</h3><p>RHEL provides a graphical interface for managing network settings.</p><h3>Automatic IP Configuration (DHCP)</h3><ol><li>Open <strong>Settings</strong>.</li><li>Navigate to Network.</li><li>Select the Ethernet connection.</li><li>Open its settings.</li><li>Under IPv4, select <strong>Automatic (DHCP)</strong>.</li><li>Save the configuration.</li></ol><p>The system obtains its IP address, gateway, and DNS settings automatically.</p><h3>Manual IP Configuration (Static)</h3><p>Navigate to the IPv4 settings and select <strong>Manual</strong>.</p><p>Enter the required configuration:</p><pre>Address: 192.168.1.100<br>Netmask: 255.255.255.0<br>Gateway: 192.168.1.1<br>DNS:     8.8.8.8</pre><p>Save the settings and reconnect if required.</p><h3>4. Configure Networking Using nmcli</h3><p>nmcli is the command-line utility used to manage NetworkManager connections and devices.</p><h3>Display Network Information</h3><pre>nmcli device status<br>nmcli connection show</pre><h3>Configure DHCP</h3><pre>nmcli connection modify &quot;Wired connection 1&quot; ipv4.method auto<br>nmcli connection up &quot;Wired connection 1&quot;</pre><p>The connection obtains its IPv4 configuration automatically through DHCP.</p><h3>Configure a Static IP Address</h3><pre>nmcli connection modify &quot;Wired connection 1&quot; \<br>ipv4.method manual \<br>ipv4.addresses 192.168.1.100/24 \<br>ipv4.gateway 192.168.1.1 \<br>ipv4.dns 8.8.8.8</pre><p>Activate the configuration:</p><pre>nmcli connection up &quot;Wired connection 1&quot;</pre><p><strong>Note:</strong> Replace the connection name and IP addresses with the values appropriate for your network.</p><h3>5. Editing Network Configuration Files</h3><p>NetworkManager stores persistent connection profiles in:</p><pre>/etc/NetworkManager/system-connections/</pre><p>List the configuration files:</p><pre>ls -l /etc/NetworkManager/system-connections/</pre><p>Modern RHEL systems commonly use .nmconnection files.</p><p>A simplified static configuration looks like this:</p><pre>[connection]<br>id=server-network<br>type=ethernet</pre><pre>[ipv4]<br>method=manual<br>addresses=192.168.1.100/24<br>gateway=192.168.1.1<br>dns=8.8.8.8</pre><p>After editing a connection profile:</p><pre>nmcli connection reload<br>nmcli connection up &quot;server-network&quot;</pre><p>NetworkManager keyfiles are the preferred configuration format in modern RHEL systems.</p><h3>6. Configure Hostnames and Name Resolution</h3><p>A hostname identifies a system on a network.</p><h3>Display the Current Hostname</h3><pre>hostnamectl</pre><h3>Configure a Static Hostname</h3><pre>hostnamectl set-hostname server1.example.com</pre><h3>Configure Local Name Resolution</h3><p>The /etc/hosts file maps hostnames to IP addresses.</p><pre>vi /etc/hosts</pre><p>Add:</p><pre>192.168.1.100 server1.example.com server1</pre><p>Test the resolution:</p><pre>getent hosts server1.example.com</pre><p>This creates a local hostname mapping. It does not create a DNS record for other systems.</p><h3>7. Understanding DNS Using nslookup</h3><p>The nslookup command queries DNS servers to retrieve information about domain names.</p><pre>nslookup google.com</pre><p>Example:</p><pre>Server:  192.168.1.1<br>Address: 192.168.1.1#53</pre><pre>Non-authoritative answer:<br>Name:    google.com<br>Address: 142.250.183.14</pre><p><strong>Understanding the output:</strong></p><ul><li>Server: The DNS server your system is querying.</li><li>Address: The IP address of that DNS server.</li><li>#53: The DNS port.</li><li>Non-authoritative answer: The responding server is not authoritative for the queried domain.</li></ul><p>The displayed DNS server may be your router, ISP resolver, or a public DNS resolver. It is not necessarily the nearest DNS server or the authoritative server for the domain.</p><h3>Find Authoritative Name Servers</h3><pre>nslookup -type=NS example.com</pre><h3>Query a Specific DNS Server</h3><pre>nslookup example.com 8.8.8.8</pre><p>This sends the query to Google’s public DNS resolver.</p><h3>8. Network Troubleshooting</h3><p>After configuring networking, verify that the system can communicate with other devices.</p><h3>Check IP Configuration</h3><pre>ip addr show</pre><h3>Check the Default Gateway</h3><pre>ip route</pre><h3>Test Gateway Connectivity</h3><pre>ping -c 4 192.168.1.1</pre><h3>Test Internet Connectivity</h3><pre>ping -c 4 8.8.8.8</pre><h3>Test DNS Resolution</h3><pre>nslookup google.com</pre><h3>Check Hostname Resolution</h3><pre>getent hosts google.com</pre><p><strong>Troubleshooting Tip:</strong> If connectivity to an IP address works but domain names fail to resolve, investigate the DNS configuration.</p><h3>Essential Commands Cheat Sheet</h3><pre>ip addr show<br>ip route<br>nmcli device status<br>nmcli connection show</pre><pre>nmcli connection modify &quot;Wired connection 1&quot; ipv4.method auto</pre><pre>hostnamectl<br>hostnamectl set-hostname server1.example.com</pre><pre>ping -c 4 8.8.8.8<br>nslookup google.com<br>getent hosts google.com</pre><h3>Conclusion</h3><p>Managing networking is an essential responsibility of a Linux system administrator.</p><p>Understanding IP addressing, routing, DHCP, DNS, and hostname resolution helps administrators configure and troubleshoot Linux servers effectively.</p><p>Through NetworkManager and nmcli, RHEL provides a flexible approach to managing network interfaces using both GUI and CLI tools.</p><p>These practical commands and concepts form an important part of RHCSA preparation and everyday Linux system administration.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=01526bbd7954" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Linux Root Password Recovery: A GRUB-Based Guide for Linux Distributions]]></title>
            <link>https://medium.com/@mayankmalakar.2006/linux-root-password-recovery-a-step-by-step-guide-using-grub-in-rhel-e1788383676f?source=rss-6f0c638f64b2------2</link>
            <guid isPermaLink="false">https://medium.com/p/e1788383676f</guid>
            <dc:creator><![CDATA[Mayank Malakar]]></dc:creator>
            <pubDate>Fri, 30 Oct 2026 17:47:44 GMT</pubDate>
            <atom:updated>2026-10-30T17:52:19.583Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KHjwzpQb1lO6_92xrEArBw.png" /></figure><p>Fortunately, Red Hat Enterprise Linux (RHEL) provides a recovery mechanism through the GRUB bootloader. By modifying the boot parameters and entering an emergency shell, an administrator can reset the root password without reinstalling the operating system.</p><p>In this article, we will explore the complete root password recovery procedure using <strong>GRUB and the </strong><strong>rd.break parameter</strong>.</p><p>This method is applicable to RHEL 8 and RHEL 9 systems and may also be used on compatible distributions such as Rocky Linux and AlmaLinux, with version-specific differences.</p><blockquote><strong><em>Disclaimer:</em></strong><em> This procedure is intended for authorized system recovery on systems you own or are permitted to administer. Access to the system console is generally required.</em></blockquote><h3>Understanding the Recovery Process</h3><p>The recovery procedure involves the following stages:</p><ol><li>Reboot the Linux system.</li><li>Modify the GRUB boot entry.</li><li>Boot into the emergency shell using rd.break.</li><li>Remount the installed root filesystem as writable.</li><li>Enter the installed system using chroot.</li><li>Reset the root password.</li><li>Trigger SELinux relabeling.</li><li>Exit the recovery environment and reboot.</li></ol><p>Let’s explore each step.</p><h3>Step 1: Reboot the System</h3><p>If you have access to an administrative account, reboot the system:</p><pre>sudo reboot</pre><p>During startup, the GRUB boot menu should appear.</p><p>If the menu is hidden, press Esc or hold Shift during startup, depending on the system configuration.</p><h3>Step 2: Modify the GRUB Boot Entry</h3><p>At the GRUB menu:</p><ol><li>Select the RHEL boot entry.</li><li>Press e to edit the entry.</li><li>Locate the line beginning with linux or linuxefi.</li><li>Move to the end of the line.</li><li>Append the following parameter:</li></ol><pre>rd.break</pre><p>The modified line may look similar to:</p><pre>linux ... rhgb quiet rd.break</pre><p>The rd.break parameter interrupts the boot process before the system transitions to its normal root filesystem.</p><p><strong>Note:</strong> Do not remove the existing kernel parameters.</p><h3>Step 3: Enter the Emergency Shell</h3><p>Press:</p><pre>Ctrl + X</pre><p>The system will boot into an emergency shell.</p><p>A prompt similar to the following may appear:</p><pre>switch_root:/#</pre><p>This environment provides access to the system’s recovery tools.</p><h3>Step 4: Remount the Root Filesystem</h3><p>The installed RHEL system is mounted under /sysroot.</p><p>Initially, this filesystem is generally read-only. To make changes, remount it as writable:</p><pre>mount -o remount,rw /sysroot</pre><p>This allows modifications to the installed operating system.</p><h3>Step 5: Enter the Installed System Using chroot</h3><p>Execute:</p><pre>chroot /sysroot</pre><p>The chroot command changes the apparent root directory of the current process.</p><p>You are now operating within the installed RHEL environment rather than the temporary recovery environment.</p><h3>Step 6: Reset the Root Password</h3><p>Run:</p><pre>passwd</pre><p>Enter the new root password when prompted.</p><p>After successful completion, you should see a message similar to:</p><pre>passwd: all authentication tokens updated successfully.</pre><p>The root password has now been updated.</p><h3>Step 7: Trigger SELinux Relabeling</h3><p>Red Hat Enterprise Linux uses SELinux to enforce mandatory access control policies.</p><p>To request a relabel during the next boot, execute:</p><pre>touch /.autorelabel</pre><p>This creates a marker file that triggers SELinux relabeling during startup.</p><p>The relabeling process may take several minutes, depending on the size and configuration of the system.</p><h3>Step 8: Exit the Recovery Environment</h3><p>Exit the installed system:</p><pre>exit</pre><p>Then exit the emergency shell:</p><pre>exit</pre><p>The system will continue its boot process.</p><p>Wait for the SELinux relabeling process to complete.</p><h3>Step 9: Verify the Recovery</h3><p>Once the system reaches the login screen, log in using:</p><pre>Username: root<br>Password: YourNewPassword</pre><p>Verify the account:</p><pre>whoami</pre><p>Expected output:</p><pre>root</pre><p>The root password recovery process is now complete.</p><h3>Complete Command Reference:</h3><p>For quick reference, the following commands are executed after entering the emergency shell:</p><pre>mount -o remount,rw /sysroot<br>chroot /sysroot<br>passwd<br>touch /.autorelabel<br>exit<br>exit</pre><p>Remember that the GRUB editing and emergency boot steps must be completed before executing these commands.</p><h3>Security Considerations</h3><p>Although GRUB-based password recovery is useful for system administration, it also highlights the importance of protecting physical and console access.</p><p>Consider the following security practices:</p><ul><li>Protect the GRUB boot menu with a password where appropriate.</li><li>Use full-disk encryption to protect data against offline access.</li><li>Keep SELinux enabled and enforcing.</li><li>Restrict physical access to production servers.</li><li>Follow organizational access control and recovery procedures.</li></ul><p>A GRUB password can help prevent unauthorized users from modifying boot parameters, while disk encryption provides additional protection for stored data.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e1788383676f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Linux Firewall Management with firewalld: Essential Commands and Configuration]]></title>
            <link>https://medium.com/@mayankmalakar.2006/linux-firewall-management-with-firewalld-essential-commands-and-configuration-87286aac6940?source=rss-6f0c638f64b2------2</link>
            <guid isPermaLink="false">https://medium.com/p/87286aac6940</guid>
            <dc:creator><![CDATA[Mayank Malakar]]></dc:creator>
            <pubDate>Fri, 30 Oct 2026 17:37:57 GMT</pubDate>
            <atom:updated>2026-10-30T17:37:57.913Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gAAJTBb7Emuk0U3U4yjPZQ.png" /></figure><p>Network security is an important part of managing Linux servers in production. A firewall helps control which services and ports are accessible, reducing unnecessary network exposure.</p><p>On Linux systems, <strong>firewalld</strong> provides a dynamic way to manage firewall rules using zones, services, and ports.</p><h3>1. Check Firewall Status</h3><pre>sudo systemctl status firewalld<br>sudo systemctl start firewalld<br>sudo systemctl enable firewalld<br>sudo firewall-cmd --state</pre><p>These commands help verify that the firewall is running and enabled.</p><h3>2. Check Active Zones and Rules</h3><pre>sudo firewall-cmd --get-active-zones<br>sudo firewall-cmd --get-default-zone<br>sudo firewall-cmd --list-all</pre><p>Zones define how network traffic is handled. In production, administrators should review the active zone and its allowed services before making changes.</p><h3>3. Allow Common Production Services</h3><p>For a web server:</p><pre>sudo firewall-cmd --permanent --add-service=http<br>sudo firewall-cmd --permanent --add-service=https</pre><p>For SSH administration:</p><pre>sudo firewall-cmd --permanent --add-service=ssh</pre><p>Apply permanent changes:</p><pre>sudo firewall-cmd --reload</pre><p><strong>Important:</strong> Before changing SSH firewall rules on a remote server, ensure you do not lock yourself out.</p><h3>4. Allow a Specific Port</h3><p>For an application running on port 8080:</p><pre>sudo firewall-cmd --permanent --add-port=8080/tcp<br>sudo firewall-cmd --reload</pre><p>Check the allowed ports:</p><pre>sudo firewall-cmd --list-ports</pre><h3>5. Remove Unnecessary Access</h3><p>Remove an allowed service:</p><pre>sudo firewall-cmd --permanent --remove-service=http<br>sudo firewall-cmd --reload</pre><p>Remove an allowed port:</p><pre>sudo firewall-cmd --permanent --remove-port=8080/tcp<br>sudo firewall-cmd --reload</pre><h3>6. Allow Access from a Specific IP</h3><p>In production, administrative access can be restricted to trusted IP addresses.</p><p>Example: Allow SSH from 192.168.13.100:</p><pre>sudo firewall-cmd --permanent --add-rich-rule=&#39;rule family=&quot;ipv4&quot; source address=&quot;192.168.13.100&quot; service name=&quot;ssh&quot; accept&#39;<br>sudo firewall-cmd --reload</pre><h3>7. Runtime vs Permanent Rules</h3><ul><li><strong>Runtime rules:</strong> Apply immediately but are lost after a reload or restart.</li><li><strong>Permanent rules:</strong> Remain configured after a reload or restart but require a reload to become active.</li></ul><p>Example:</p><pre>sudo firewall-cmd --add-service=https<br>sudo firewall-cmd --permanent --add-service=https<br>sudo firewall-cmd --reload</pre><h3>Conclusion</h3><p>firewalld is an important tool for Linux server security. In production environments, administrators commonly use it to allow required services, manage application ports, restrict administrative access, and remove unnecessary network exposure.</p><p>Understanding these commands helps build a stronger foundation in Linux system administration and network security.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=87286aac6940" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SELinux in Linux: Essential Security Commands and Configuration]]></title>
            <link>https://medium.com/@mayankmalakar.2006/selinux-in-linux-essential-security-commands-and-configuration-71edb65bcae4?source=rss-6f0c638f64b2------2</link>
            <guid isPermaLink="false">https://medium.com/p/71edb65bcae4</guid>
            <dc:creator><![CDATA[Mayank Malakar]]></dc:creator>
            <pubDate>Fri, 30 Oct 2026 17:31:20 GMT</pubDate>
            <atom:updated>2026-10-30T17:31:20.935Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w8mxux-fUF52gCvhUZ3dPg.png" /></figure><h3>SELinux in Linux: Essential Security Commands and Configuration</h3><p>As part of my <strong>RHCSA (Red Hat Certified System Administrator) learning journey</strong> and ongoing exploration of cybersecurity, I studied <strong>SELinux (Security-Enhanced Linux)</strong> and its role in strengthening Linux system security.</p><p>SELinux provides an additional layer of protection through <strong>Mandatory Access Control (MAC)</strong>. It enforces security policies that define how processes interact with files, directories, services, and other system resources.</p><h3>Understanding SELinux Contexts:</h3><p>SELinux assigns a security context to files, directories, and processes. These contexts help SELinux determine whether access should be allowed or denied.</p><p>A typical SELinux context follows this format:</p><pre>user:role:type:level</pre><p>For example:</p><pre>system_u:object_r:httpd_sys_content_t:s0</pre><p>The fields represent:</p><ul><li><strong>User:</strong> SELinux identity associated with the object.</li><li><strong>Role:</strong> Defines the role used in SELinux access control.</li><li><strong>Type:</strong> Defines the type used by SELinux policy to control access.</li><li><strong>Level:</strong> Represents the security level, used in Multi-Level Security (MLS).</li></ul><p>The <strong>type</strong> is especially important in common SELinux policies. For example, httpd_t is a type commonly associated with the Apache HTTP server process, while httpd_sys_content_t is used for web content files.</p><p>The suffix _t commonly identifies SELinux types, but the exact meaning depends on the policy.</p><h3>View SELinux Contexts</h3><pre>ls -Z<br>ls -aZ</pre><ul><li>ls -Z displays SELinux contexts for files and directories.</li><li>ls -aZ displays contexts for all files, including hidden files.</li></ul><h3>Understanding SELinux Modes</h3><p>SELinux operates in three modes:</p><ul><li><strong>Enforcing:</strong> Enforces SELinux policies and blocks unauthorized access.</li><li><strong>Permissive:</strong> Records policy violations without blocking access.</li><li><strong>Disabled:</strong> Turns off SELinux protection.</li></ul><h3>Check SELinux Status</h3><pre>getenforce<br>sestatus</pre><h3>Change the Current SELinux Mode</h3><pre>setenforce 0<br>setenforce 1</pre><p>setenforce 0 switches to Permissive mode, while setenforce 1 switches to Enforcing mode.</p><h3>Configure the Default SELinux Mode</h3><p>The default mode is configured in:</p><pre>vim /etc/selinux/config</pre><p>Set the required mode:</p><pre>SELINUX=enforcing</pre><p>This configuration takes effect after a system reboot.</p><h3>Managing SELinux File Contexts:</h3><p>SELinux uses file contexts to determine how files and directories are accessed under its security policies.</p><h3>View File Context Rules</h3><pre>semanage fcontext -l</pre><h3>Add a File Context Rule</h3><pre>semanage fcontext -a -t httpd_sys_content_t &quot;/web(/.*)?&quot;</pre><h3>Apply the SELinux Context</h3><pre>restorecon -Rv /web</pre><p>The semanage fcontext command manages persistent file context rules, while restorecon applies the contexts defined by the policy.</p><h3>Managing SELinux Booleans:</h3><p>SELinux Booleans allow administrators to enable or disable specific policy features without modifying the entire SELinux policy.</p><h3>View Boolean Settings</h3><pre>getsebool -a<br>semanage boolean -l</pre><h3>Enable a Boolean</h3><pre>setsebool httpd_enable_homedirs on</pre><p>To make the change persistent across reboots:</p><pre>setsebool -P httpd_enable_homedirs on</pre><p>SELinux Boolean documentation can also be explored through relevant manual pages ending in _selinux.</p><h3>Troubleshooting SELinux Issues</h3><p>SELinux denials can be investigated using system logs and analysis tools.</p><h3>Analyze SELinux Logs</h3><pre>sealert -a /var/log/audit/audit.log</pre><p>The sealert command helps identify SELinux-related access denials and provides useful troubleshooting information.</p><h3>Key Takeaways</h3><p>This RHCSA practice helped me understand how SELinux strengthens Linux security through policy-based access control.</p><p>I gained practical experience in understanding SELinux contexts, managing enforcement modes, configuring file contexts, adjusting policy using Booleans, and investigating access denials.</p><p>Understanding SELinux is an important step toward building secure Linux systems and developing stronger system administration and cybersecurity skills.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=71edb65bcae4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[NFS & AutoFS in Linux: Network File Sharing and Automated Mounting]]></title>
            <link>https://medium.com/@mayankmalakar.2006/nfs-autofs-in-linux-network-file-sharing-and-automated-mounting-35dae8176ddd?source=rss-6f0c638f64b2------2</link>
            <guid isPermaLink="false">https://medium.com/p/35dae8176ddd</guid>
            <dc:creator><![CDATA[Mayank Malakar]]></dc:creator>
            <pubDate>Fri, 30 Oct 2026 17:20:11 GMT</pubDate>
            <atom:updated>2026-10-30T17:20:11.620Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Emmy3J7WEUU-uO4W0XqyGA.png" /></figure><h3>NFS &amp; AutoFS in Linux: Secure Network File Sharing and Automated Mounting</h3><p>As part of my RHCSA (Red Hat Certified System Administrator) course and ongoing cybersecurity journey, I practiced configuring NFS and AutoFS in Linux.</p><p>NFS allows Linux systems to share directories over a network, while AutoFS automatically mounts network filesystems when they are accessed.</p><p>In this practical, I worked with NFS server configuration, client-side mounting using /etc/fstab, and automatic mounting using AutoFS.</p><h3>Understanding NFS</h3><p>NFS (Network File System) is a protocol that allows systems to share directories over a network.</p><p>It follows a client-server architecture:</p><ul><li><strong>NFS Server:</strong> Shares directories and controls client access.</li><li><strong>NFS Client:</strong> Connects to the server and accesses shared files.</li><li><strong>Export Directory:</strong> The directory shared by the server.</li><li><strong>Mount Point:</strong> The local directory used to access the remote share.</li></ul><p>For example, a server can share /database, which a client accesses through /first_gen.</p><h3>(1) NFS Server Configuration:</h3><h3>Install NFS Utilities</h3><pre>dnf install nfs-utils -y</pre><h3>Start and Enable the NFS Service</h3><pre>systemctl enable --now nfs-server<br>systemctl status nfs-server</pre><h3>Check SELinux Mode</h3><pre>getenforce</pre><p>In a lab environment, SELinux can temporarily be set to permissive mode for troubleshooting:</p><pre>setenforce 0</pre><p>For production systems, it is recommended to keep SELinux in enforcing mode and configure the required policies.</p><h3>Configure the Firewall</h3><pre>firewall-cmd --permanent --add-service=nfs<br>firewall-cmd --permanent --add-service=mountd<br>firewall-cmd --reload<br>firewall-cmd --list-services</pre><h3>Create the Shared Directory</h3><pre>mkdir -p /database</pre><h3>Configure NFS Exports</h3><p>Edit the configuration file:</p><pre>vim /etc/exports</pre><p>Add the following entry:</p><pre>/database 192.168.13.0/24(rw,sync)</pre><p>This shares /database with clients in the 192.168.13.0/24 subnet.</p><ul><li>rw allows read and write access.</li><li>sync ensures changes are committed before the server responds.</li></ul><h3>Apply the Export Configuration:</h3><pre>exportfs -rav<br>exportfs -v</pre><h3>Verify the Shared Directory:</h3><pre>cd /database<br>touch morning<br>ls -l<br>ip a</pre><p>For this practical, the NFS server IP address is:</p><pre>192.168.13.135</pre><h3>NFS Client Configuration Using /etc/fstab</h3><h3>Install NFS Utilities</h3><pre>dnf install nfs-utils -y</pre><h3>Create the Mount Point</h3><pre>mkdir -p /first_gen</pre><h3>Configure Persistent Mounting</h3><p>Edit /etc/fstab:</p><pre>vim /etc/fstab</pre><p>Add:</p><pre>192.168.13.135:/database /first_gen nfs defaults,_netdev 0 0</pre><p>The _netdev option indicates that the filesystem depends on network connectivity.</p><h3>Mount the NFS Share</h3><pre>mount -a</pre><h3>Verify the Mount</h3><pre>df -hT<br>lsblk<br>cd /first_gen<br>ls -l</pre><p>Create test files and directories:</p><pre>touch hii<br>mkdir mobile<br>ls -l</pre><p>The changes are reflected on the NFS server because both systems access the same shared directory.</p><h3>(2)Automatic Mounting Using AutoFS</h3><p>AutoFS mounts filesystems automatically when they are accessed. It can also unmount them after a period of inactivity.</p><h3>Install AutoFS</h3><pre>dnf install autofs -y</pre><h3>Configure the Master Map</h3><p>Edit the file:</p><pre>vim /etc/auto.master.d/aa.autofs</pre><p>Add:</p><pre>/- /etc/auto.misc</pre><p>This configures AutoFS to use /etc/auto.misc as its map file.</p><h3>Configure the AutoFS Map</h3><p>Edit:</p><pre>vim /etc/auto.misc</pre><p>Add:</p><pre>/sunday -rw,soft 192.168.13.135:/sunday</pre><p>This defines the remote NFS share that AutoFS will mount when /sunday is accessed.</p><h3>Start and Enable AutoFS</h3><pre>systemctl enable --now autofs</pre><p>If you modify the map files, restart AutoFS:</p><pre>systemctl restart autofs</pre><h3>Access the NFS Share</h3><pre>cd /sunday<br>ls -l</pre><p>Accessing the directory triggers the automatic mount.</p><p>Create test files:</p><pre>mkdir hii<br>touch jii<br>ls -l</pre><p>AutoFS automatically unmounts the share after the configured period of inactivity.</p><h3>Important Commands:</h3><pre>dnf install nfs-utils -y<br>systemctl enable --now nfs-server<br>systemctl status nfs-server<br>exportfs -rav<br>exportfs -v<br>showmount -e server-ip<br>mount -t nfs server:/share /mnt<br>mount -a<br>df -hT<br>systemctl enable --now autofs<br>systemctl restart autofs</pre><h3>6. Important Configuration Files</h3><p><strong>NFS:</strong></p><ul><li>/etc/exports — Defines shared directories and client access.</li><li>/etc/fstab — Configures persistent filesystem mounts.</li></ul><p><strong>AutoFS:</strong></p><ul><li>/etc/auto.master — Main AutoFS configuration.</li><li>/etc/auto.master.d/aa.autofs — Additional master map configuration.</li><li>/etc/auto.misc — Defines AutoFS mount mappings.</li><li>/etc/autofs.conf — Global AutoFS configuration.</li></ul><h3>Key Takeaways</h3><p>NFS provides network-based file sharing, while AutoFS simplifies access through automatic, on-demand mounting.</p><p>Through this RHCSA practical, I gained hands-on experience with NFS server configuration, client mounting, persistent mounts, and AutoFS.</p><p>This practice strengthened my understanding of Linux system administration and network resource management as part of my cybersecurity learning journey.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=35dae8176ddd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Importance of SSH in Linux: Secure Remote Access & System Administration]]></title>
            <link>https://medium.com/@mayankmalakar.2006/the-importance-of-ssh-in-linux-secure-remote-access-system-administration-b69ae8234c2a?source=rss-6f0c638f64b2------2</link>
            <guid isPermaLink="false">https://medium.com/p/b69ae8234c2a</guid>
            <dc:creator><![CDATA[Mayank Malakar]]></dc:creator>
            <pubDate>Fri, 30 Oct 2026 13:47:50 GMT</pubDate>
            <atom:updated>2026-10-30T13:47:50.558Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m0yWGFXMuV3DKg_uyp1SqA.png" /></figure><p>As part of my <strong>RHCSA (Red Hat Certified System Administrator) course</strong> and ongoing cybersecurity journey, I explored OpenSSH and its role in secure remote system administration.</p><p>SSH (Secure Shell) is a network protocol that enables encrypted communication, remote login, and command execution across systems. OpenSSH is its widely used open-source implementation, providing secure access to Linux, Unix, Windows, and other systems.</p><h3>Essential SSH Commands</h3><p><strong>1. Remote Access and Command Execution</strong></p><pre>ssh username@remote-ip</pre><p>Establishes a secure connection to a remote system.</p><pre>ssh username@remote-ip &quot;uptime&quot;</pre><p>Executes a command on a remote system without opening an interactive session.</p><p><strong>2. Connecting Through a Custom Port</strong></p><pre>ssh -p 121 username@remote-ip</pre><p>Connects to a remote system using port 121 instead of the default SSH port 22. This is useful when the SSH server is configured to listen on a different port.</p><p><strong>3. SSH Key-Based Authentication</strong></p><pre>ssh-keygen</pre><p>Generates a public-private SSH key pair for secure authentication.</p><pre>ssh-copy-id username@remote-ip</pre><p>Copies the public key to the remote system, enabling passwordless SSH authentication.</p><p><strong>4. Configuring and Securing OpenSSH</strong></p><pre>sudo vi /etc/ssh/sshd_config</pre><p>Opens the SSH server configuration file to customize authentication, port settings, and access control.</p><p>Important security configurations:</p><pre>PermitRootLogin no<br>PasswordAuthentication no<br>PubkeyAuthentication yes</pre><p>These settings disable direct root login and password-based authentication while allowing public-key authentication, helping strengthen remote access security.</p><p><strong>5. Managing the SSH Service</strong></p><pre>sudo systemctl status sshd</pre><p>Checks the status of the SSH server.</p><pre>sudo systemctl enable --now sshd</pre><p>Enables the SSH service to start automatically at boot and starts it immediately.</p><h3>Cybersecurity Perspective:</h3><p>SSH is an essential component of secure remote administration. Key-based authentication, restricted root access, and disabling password-based authentication help reduce the attack surface and strengthen access security.</p><p>Through this RHCSA learning module, I gained practical insights into secure remote access, authentication mechanisms, and OpenSSH configuration — building a stronger foundation in Linux administration and cybersecurity.z</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b69ae8234c2a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Linux Boot Process: From BIOS/UEFI to systemd and System Targets]]></title>
            <link>https://medium.com/@mayankmalakar.2006/linux-boot-process-from-bios-uefi-to-systemd-and-system-targets-b044f03faa37?source=rss-6f0c638f64b2------2</link>
            <guid isPermaLink="false">https://medium.com/p/b044f03faa37</guid>
            <dc:creator><![CDATA[Mayank Malakar]]></dc:creator>
            <pubDate>Mon, 05 Oct 2026 13:42:52 GMT</pubDate>
            <atom:updated>2026-10-05T13:42:52.547Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7GdZkUpx5imL_W-_owVEQg.png" /></figure><p>The Linux boot process is the sequence that takes a system from <strong>power-on to a fully running operating system</strong>.</p><p>For Linux administrators, understanding this flow helps troubleshoot boot failures, kernel problems, target issues, and service failures.</p><pre>BIOS / UEFI<br>     ↓<br>POST<br>     ↓<br>MBR / GPT<br>     ↓<br>GRUB2<br>     ↓<br>Kernel + initramfs<br>     ↓<br>systemd (PID 1)<br>     ↓<br>Targets<br>     ↓<br>Services<br>     ↓<br>Login / User Environment</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AxIFJE0xjIcwEMHMAxnD-w.png" /></figure><h3>1. BIOS / UEFI and POST</h3><p>When the system starts, <strong>BIOS or UEFI</strong> initializes the hardware and identifies the boot device.</p><p><strong>POST (Power-On Self-Test)</strong> checks essential hardware such as memory, processor, and storage.</p><p>If POST fails, Linux has not started yet; the problem is at the hardware or firmware stage.</p><h3>Useful command</h3><p>Once Linux is running, hardware information can be inspected with:</p><pre>lscpu</pre><h3>2. MBR and GPT</h3><p>The firmware identifies the storage device containing the boot information.</p><p><strong>MBR (Master Boot Record)</strong> is the older partitioning scheme traditionally associated with BIOS.</p><p><strong>GPT (GUID Partition Table)</strong> is the modern partitioning scheme commonly used with UEFI.</p><p>Check disks and partitions:</p><pre>lsblk</pre><p>View partition-table information:</p><pre>sudo fdisk -l</pre><p>Or:</p><pre>sudo parted -l</pre><h3>3. GRUB2</h3><p><strong>GRUB2</strong> is the bootloader. It presents boot options and loads the selected kernel and initramfs.</p><p>Common configuration locations include:</p><pre>/etc/default/grub<br>/etc/grub.d/</pre><p>View the main configuration:</p><pre>cat /etc/default/grub</pre><p>On RHEL-based systems, GRUB configuration can be generated with:</p><pre>grub2-mkconfig</pre><p>The exact output path depends on the system’s BIOS/UEFI configuration.</p><h3>4. Linux Kernel and initramfs</h3><p>GRUB loads the <strong>Linux kernel</strong> and <strong>initramfs</strong>.</p><p>The kernel manages core resources such as:</p><ul><li>CPU</li><li>Memory</li><li>Processes</li><li>Hardware</li><li>Drivers</li><li>Filesystems</li><li>Networking</li></ul><p>Check the running kernel:</p><pre>uname -r</pre><p>View boot files:</p><pre>ls /boot/</pre><p>On RHEL-based systems, dracut is commonly used to manage initramfs images.</p><h3>5. systemd</h3><p>After kernel initialization, the system starts the first userspace process, normally:</p><pre>systemd</pre><p>systemd runs as <strong>PID 1</strong> and manages system startup, services, mounts, sockets, timers, dependencies, and targets.</p><p>Verify PID 1:</p><pre>ps -p 1 -o pid,comm,args</pre><p>Check systemd-managed units:</p><pre>systemctl</pre><h3>6. Runlevels and systemd Targets</h3><p>Traditional Linux systems used <strong>SysV runlevels</strong>. Modern Linux systems use <strong>systemd targets</strong>.</p><p>RunlevelTraditional Purpose0Power off1Single-user / Rescue2Multi-user, distribution-dependent3Multi-user text mode4Traditionally unused/custom5Graphical mode6Reboot</p><p>Common systemd targets include:</p><pre>poweroff.target<br>rescue.target<br>multi-user.target<br>graphical.target<br>reboot.target</pre><p>Runlevels are now mainly a legacy concept.</p><p>Check the current default target:</p><pre>systemctl get-default</pre><h3>7. Managing Targets</h3><p>A systemd target represents a particular system state and groups the units required for that state.</p><p>Set the default target:</p><pre>systemctl set-default multi-user.target</pre><p>Switch the currently running system:</p><pre>systemctl isolate multi-user.target</pre><p>Switch to graphical mode:</p><pre>systemctl isolate graphical.target</pre><p>The difference is important:</p><ul><li>set-default → affects future boots.</li><li>isolate → changes the current running state.</li></ul><h3>8. Services During Boot</h3><p>Targets activate required services and other systemd units.</p><p>Check a service:</p><pre>systemctl status sshd</pre><p>Enable a service at boot:</p><pre>systemctl enable sshd</pre><p>Enable and start it immediately:</p><pre>systemctl enable --now sshd</pre><p>Check failed services:</p><pre>systemctl --failed</pre><h3>9. Boot Troubleshooting</h3><p>The boot sequence provides a useful troubleshooting model:</p><pre>Firmware<br>   ↓<br>GRUB2<br>   ↓<br>Kernel / initramfs<br>   ↓<br>systemd<br>   ↓<br>Target<br>   ↓<br>Service</pre><p>View current boot logs:</p><pre>journalctl -b</pre><p>View errors from the current boot:</p><pre>journalctl -b -p err</pre><p>View the previous boot:</p><pre>journalctl -b -1</pre><p>Check failed services:</p><pre>systemctl --failed</pre><h3>10. Important Command Reference</h3><h3>Disk and Boot</h3><pre>lsblk<br>fdisk -l<br>parted -l<br>cat /etc/default/grub<br>ls /boot/</pre><h3>Kernel</h3><pre>uname -r<br>uname -a</pre><h3>systemd and Targets</h3><pre>systemctl get-default<br>systemctl set-default &lt;target&gt;<br>systemctl isolate &lt;target&gt;<br>systemctl list-units --type=target<br>systemctl --failed</pre><h3>Boot Troubleshooting</h3><pre>journalctl -b<br>journalctl -b -1<br>journalctl -b -p err<br>systemctl list-dependencies</pre><h3>Conclusion:</h3><p>The Linux boot process is a structured sequence where each stage prepares the system for the next:</p><p><strong>BIOS/UEFI → POST → MBR/GPT → GRUB2 → Kernel + initramfs → systemd → Targets → Services → Login</strong></p><p>Understanding these stages gives Linux administrators a clear way to approach <strong>boot management and troubleshooting</strong>. When a system fails to start, the administrator can identify the stage where the problem occurs and use the appropriate tools, commands, and logs to investigate it.</p><p>A solid understanding of <strong>GRUB2, the Linux kernel, initramfs, systemd, targets, and services</strong> provides an essential foundation for managing and troubleshooting reliable Linux systems in production environments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b044f03faa37" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Linux Log Management: systemd-journald and rsyslog]]></title>
            <link>https://medium.com/@mayankmalakar.2006/linux-log-management-systemd-journald-and-rsyslog-97553135110e?source=rss-6f0c638f64b2------2</link>
            <guid isPermaLink="false">https://medium.com/p/97553135110e</guid>
            <dc:creator><![CDATA[Mayank Malakar]]></dc:creator>
            <pubDate>Mon, 05 Oct 2026 13:17:58 GMT</pubDate>
            <atom:updated>2026-10-05T13:17:58.251Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iRVGf7vXiYZ2_MmSsUPgDA.png" /></figure><p>Log management is a fundamental Linux administration task. In production environments, logs help administrators monitor services, troubleshoot failures, and investigate system activity.</p><p>For cybersecurity, logs provide visibility into authentication attempts, system events, and suspicious activity, making them important for monitoring and incident investigation.</p><p>Linux commonly uses two important logging services:</p><ul><li><strong>systemd-journald</strong> — collects and manages system and service logs.</li><li><strong>rsyslog</strong> — processes, filters, stores, and forwards log messages.</li></ul><h3>Topic 1: systemd-journald</h3><p>systemd-journald is integrated with systemd and collects logs from the kernel, services, applications, and system events.</p><p>The main tool for viewing these logs is journalctl.</p><h3>1. Check the Service</h3><pre>systemctl status systemd-journald</pre><p>Check whether it is active:</p><pre>systemctl is-active systemd-journald</pre><h3>2. View and Monitor Logs</h3><p>Display journal entries:</p><pre>journalctl</pre><p>Show recent entries:</p><pre>journalctl -n 50</pre><p>Monitor logs in real time:</p><pre>journalctl -f</pre><p>View logs from the current boot:</p><pre>journalctl -b</pre><p>View logs for a specific service:</p><pre>journalctl -u sshd</pre><p>Monitor that service continuously:</p><pre>journalctl -u sshd -f</pre><h3>3. Filter Logs</h3><p>View errors:</p><pre>journalctl -p err</pre><p>View kernel messages:</p><pre>journalctl -k</pre><p>View recent logs:</p><pre>journalctl --since &quot;1 hour ago&quot;</pre><p>These filters are useful when troubleshooting production systems with large amounts of log data.</p><h3>4. journald Configuration</h3><p>The main configuration file is:</p><pre>/etc/systemd/journald.conf</pre><p>For persistent journal storage:</p><pre>[Journal]<br>Storage=persistent</pre><p>Persistent logs are normally stored under:</p><pre>/var/log/journal/</pre><p>After changing the configuration:</p><pre>systemctl restart systemd-journald</pre><p>Check journal disk usage:</p><pre>journalctl --disk-usage</pre><h3>Topic 2: rsyslog</h3><p>rsyslog provides flexible logging through filtering, storage, routing, and remote log forwarding.</p><p>It is commonly used for traditional log files and centralized logging environments.</p><h3>1. Manage the Service</h3><p>Check rsyslog:</p><pre>systemctl status rsyslog</pre><p>Enable and start it:</p><pre>systemctl enable --now rsyslog</pre><p>Restart after configuration changes:</p><pre>systemctl restart rsyslog</pre><h3>2. Configure rsyslog</h3><p>The primary configuration file is:</p><pre>/etc/rsyslog.conf</pre><p>Additional configuration files are commonly stored in:</p><pre>/etc/rsyslog.d/</pre><p>View the main configuration:</p><pre>cat /etc/rsyslog.conf</pre><p>Before restarting after changes, validate the configuration:</p><pre>rsyslogd -N1</pre><h3>3. Understanding rsyslog Rules</h3><p>A basic rsyslog rule follows:</p><pre>facility.priority    action</pre><p>For example:</p><pre>authpriv.*    /var/log/secure</pre><p>This sends authentication-related messages to /var/log/secure.</p><p>Common facilities include:</p><pre>authpriv<br>cron<br>daemon<br>kern<br>mail<br>user<br>local0-local7</pre><p>Common priorities include:</p><pre>emerg<br>alert<br>crit<br>err<br>warning<br>notice<br>info<br>debug</pre><h3>4. Create a Custom Logging Rule</h3><p>Create a custom configuration file:</p><pre>vim /etc/rsyslog.d/custom.conf</pre><p>Add:</p><pre>local0.*    /var/log/custom.log</pre><p>Validate the configuration:</p><pre>rsyslogd -N1</pre><p>Then restart rsyslog:</p><pre>systemctl restart rsyslog</pre><h3>5. Test the Configuration</h3><p>The logger command can generate a test message:</p><pre>logger -p local0.info &quot;Test logging message&quot;</pre><p>Check the custom log:</p><pre>tail /var/log/custom.log</pre><p>Monitor it continuously:</p><pre>tail -f /var/log/custom.log</pre><h3>Production Log Files</h3><p>Depending on the distribution and configuration, common log files include:</p><pre>/var/log/messages<br>/var/log/secure<br>/var/log/cron<br>/var/log/maillog</pre><p>Monitor a log:</p><pre>tail -f /var/log/messages</pre><p>Monitor authentication activity:</p><pre>tail -f /var/log/secure</pre><p>Search for failed authentication attempts:</p><pre>grep &quot;Failed&quot; /var/log/secure</pre><p>The exact files can vary between Linux distributions.</p><h3>Log Rotation</h3><p>Production systems continuously generate logs, so old logs must be managed to prevent excessive disk usage.</p><p>Linux commonly uses <strong>logrotate</strong> for this purpose.</p><p>Main configuration:</p><pre>/etc/logrotate.conf</pre><p>Additional configurations:</p><pre>/etc/logrotate.d/</pre><p>Check the package:</p><pre>rpm -q logrotate</pre><p>Log rotation can compress, retain, and remove older logs according to configured policies.</p><h3>systemd-journald vs rsyslog</h3><p><strong>systemd-journald</strong> is primarily integrated with systemd and provides structured access to system, boot, and service logs through journalctl.</p><p><strong>rsyslog</strong> provides flexible filtering, traditional log files, custom rules, and log forwarding.</p><p>They can work <strong>together</strong> in a production Linux environment rather than being alternatives.</p><h3>Why Log Management Matters in Cybersecurity</h3><p>Linux logs provide visibility into events such as:</p><ul><li>Failed and successful authentication</li><li>Privilege-related activity</li><li>Service failures</li><li>Unexpected system activity</li><li>Configuration or operational events</li></ul><p>A security investigation might correlate events like:</p><pre>Repeated failed SSH attempts<br>        ↓<br>Successful authentication<br>        ↓<br>Unexpected process activity<br>        ↓<br>Suspicious network activity<br>        ↓<br>Investigation</pre><p>These logs can also be forwarded to centralized <strong>SIEM platforms</strong> for correlation and security monitoring.</p><h3>Important Commands</h3><h3>systemd-journald:</h3><pre>journalctl<br>journalctl -f<br>journalctl -b<br>journalctl -u &lt;service&gt;<br>journalctl -p err<br>journalctl --since &quot;1 hour ago&quot;<br>journalctl --disk-usage</pre><h3>rsyslog:</h3><pre>systemctl status rsyslog<br>systemctl enable --now rsyslog<br>systemctl restart rsyslog<br>rsyslogd -N1<br>cat /etc/rsyslog.conf</pre><h3>Monitoring and Testing:</h3><pre>tail -f /var/log/messages<br>tail -f /var/log/secure<br>grep &quot;Failed&quot; /var/log/secure<br>logger -p local0.info &quot;Test message&quot;</pre><h3>Production Perspective</h3><p>Effective log management makes Linux systems <strong>observable, searchable, and easier to troubleshoot</strong>.</p><p>A Linux administrator should be comfortable with:</p><ul><li>journalctl for system and service logs</li><li>/etc/rsyslog.conf for rsyslog configuration</li><li>/etc/rsyslog.d/ for custom rules</li><li>Real-time log monitoring</li><li>Log rotation and retention</li><li>Basic log filtering and troubleshooting</li></ul><p>For cybersecurity professionals, these same skills provide the foundation for <strong>security monitoring, event correlation, and incident investigation</strong>.</p><h3>Conclusion</h3><p>Understanding <strong>systemd-journald, </strong><strong>journalctl, rsyslog, </strong><strong>/etc/rsyslog.conf, </strong><strong>logger, log files, and logrotate</strong> provides a practical foundation for managing logs on production Linux systems.</p><p>Good log management is not just about storing messages — it is about making system activity <strong>visible and useful for administration, troubleshooting, and security investigations</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=97553135110e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>