Posts

Showing posts with the label Linux Security

Mastering Ubuntu 24.04 Networking: Configuration and Troubleshooting Tips

Image
Whether you are a student experimenting on a personal laptop or a systems engineer managing bare-metal servers in a remote data center, mastering network configuration and troubleshooting is a non-negotiable skill. When a server drops off the network—and eventually, one always does—you need to know exactly which commands to run to prove where the fault lies. In this guide, we will walk through the essential network configuration and troubleshooting workflows specifically tailored for Ubuntu 24.04 LTS (Noble Numbat). 01. Interface IP Configuration To function within a local network, a device needs an IP address. If it needs to access the internet or communicate with devices on different subnets, it also requires a default gateway. When configuring these IP settings, don't be surprised if your configurations suddenly disappear after a system reboot! This happens because Ubuntu utilizes two distinct types of network configuration: Live (Temporary) and Persistent . 01.1. Live (Tempora...

Enable Communication Between GNS3 Appliances & The Host Machine (Ubuntu 24.04)

Image
Recently, I set up a GNS3 server using an Ubuntu 24.04 VM to run and test my network emulations. While working on a project, I needed to establish an SSH connection between the host (the Ubuntu 24.04 server) and the virtual GNS3 appliances running inside it. The basic network configuration was straightforward, and I could ping the devices just fine. However, I quickly hit a wall when trying to SSH into legacy appliances (like the Cisco C7200). Because modern Ubuntu 24.04 uses updated OpenSSH protocols, it actively rejects the older cryptographic algorithms offered by these legacy devices. Getting this working required some specific SSH workarounds, so I decided to turn this into a runbook documentation for my future self—and for anyone else dealing with connection refused errors in their GNS3 labs. Prerequisites Before we jump into the SSH workarounds, make sure you have the base lab environment up and running: A Working GNS3 Server: For this guide, we are using an Ubuntu 24.04 host. ...

How to Prevent Email Sender Spoofing by Authenticated Users in Postfix

Image
Recently, one of our clients’ email addresses was compromised and used to send spam emails as part of a phishing attack. The issue occurred because one particular mailbox was configured with a weak password, allowing an attacker to gain access to the account. After successfully authenticating to the mail server, the attacker used the compromised account to send spam emails while forging a different sender identity. For example, although the legitimate account was myuser@somedomain.com , the attacker authenticated using this account but sent emails with a forged From address such as fakeuser@phishingdomain.com to distribute phishing messages. To defend against situations like this, it is important to implement multiple safeguards. In addition to educating staff to use strong but easy-to-remember passwords (so they do not write them down), administrators should configure rate limiting and enforce sender restrictions. These restrictions ensure that authenticated mailboxes can only send e...

How to Configure SSL In Multi-Tenant Email Servers Using SNI

Image
Running a multi-tenant or multi-domain email server introduces unique SSL challenges. Each hosted domain must present the correct certificate while being handled seamlessly by Postfix (SMTP) and Dovecot (IMAP/POP3). This guide shows a production-ready way to configure SSL using SNI with Postfix, Dovecot, and Let’s Encrypt. This guide assumes: Postfix and Dovecot are already installed and working. Valid SSL certificates are already issued for each mail hostname Let's get started! Postfix SNI Configuration In this step we will first configure default TLS settings using your primary domain so that postfix can use it when either the client sends no SNI at all, or the client sends SNI, but the name doesn't match anything in the tls_server_sni_maps table. Open /etc/postfix/main.cf. sudo nano /etc/postfix/main.cf Make sure the following lines are present or add them if not. Replace  mail.primary_domain.com with your own primary hostname. # Enable TLS Encryption when Postfix recei...

How to Reset Root Password on Rocky Linux 9/10, RHEL 9, CentOS Stream: GRUB Guide

Image
Losing or forgetting the root password can lock you out of a Linux system entirely. This guide explains how to safely reset the root password on RHEL-based distributions (RHEL, CentOS, Rocky Linux) using the GRUB recovery method. The demonstration uses Rocky Linux, but the same steps apply to all RHEL-based distributions. Please Note:  This guide is intended for system owners or administrators with authorized access to the system. This method requires direct console access (physical or virtual) to the system. It cannot be performed over SSH. For encrypted systems, the LUKS passphrase is still required to unlock the disk before proceeding. Step 01:  Access GRUB Edit Mode Reboot the system (VM: power cycle; physical: shutdown -r if you have sudo). At the GRUB boot menu , press E    (or Shift during boot if hidden) and select the first entry (latest kernel) with arrows if needed. Step 02:  Modify Kernel Parameters Locate the kernel line that starts with linux or li...