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
ssh-i your-key.pem ubuntu@your-public-ip
Always create a backup before editing:
sudocp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak
Open the SSH config file:
sudo nano /etc/ssh/sshd_config