-
Edit the SSH config file:
nano /etc/ssh/sshd_config
-
Change the default port from 22 to something custom:
Port 2222
-
Disable root login:
PermitRootLogin no
-
Enable public key authentication:
PasswordAuthentication no
-
Restart SSH:
systemctl restart sshd
-
Always test new settings in a secondary session before closing the original.
Most Popular Articles
How to Install and Configure a LAMP Stack on Your Linux VPS
For CentOS/Ubuntu: Run: sudo apt install apache2 mysql-server php php-mysql (Ubuntu) or yum...
How to Set Up Email Services on Your VPS
Install Postfix (Linux) or MailEnable (Windows). Set DNS records (MX, SPF, DKIM, DMARC)....
How to Schedule Automatic Backups on Your VPS
Use rsync and cron jobs.
How to Install and Configure cPanel on Your Linux VPS
Ensure your VPS is running a supported OS (CentOS, AlmaLinux, RockyLinux). Run: yum...
How to Set Up UFW Firewall on Ubuntu VPS
Install UFW: sudo apt install ufw Set default policies: ufw default deny incoming...