📌 Brief Overview

Securing remote access to cloud servers is a fundamental responsibility in cloud security and system administration. By default, SSH runs on port 22, which is widely known and frequently targeted by automated brute-force attacks.

As part of implementing basic server hardening on an AWS EC2 instance, I changed the default SSH port to a custom port using Linux system configurations and updated the corresponding AWS Security Group rules. This process enhances security posture by reducing exposure to automated scanning and unauthorized access attempts.

The configuration involved:

HERE IS THE ARCHITECTURE DESIGN

20260220-1326-29.5000512.mp4

Here is How to Change SSH Port on AWS EC2 (Linux)

🧱 Step 1: Connect to Your EC2 Instance

ssh-i your-key.pem ubuntu@your-public-ip

🛑 Step 2: Backup SSH Configuration File (Important)

Always create a backup before editing:

sudocp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak

✏️ Step 3: Edit SSH Configuration File

Open the SSH config file:

sudo nano /etc/ssh/sshd_config