Securing SSH on a Linux VPS: five essential steps

27.11.2026 · Güvenlik

Securing SSH on a Linux VPS: five essential steps

As soon as a server gets a public IP address, automated bots start guessing SSH passwords. Five steps make those attempts useless.

## 1. Use SSH keys
Generate a key pair on your computer (ssh-keygen -t ed25519) and add the public key to ~/.ssh/authorized_keys on the server.

## 2. Disable password login
In /etc/ssh/sshd_config set PasswordAuthentication no — only after confirming that key login works in a second session.

## 3. Do not log in as root
Create a normal user with sudo rights and set PermitRootLogin no (or prohibit-password).

## 4. Add a firewall and brute-force protection
Allow only the ports you need (for example 22, 80, 443) with ufw or firewalld, and install fail2ban to block repeated failures.

## 5. Keep the system updated
Enable automatic security updates or schedule them weekly. Our European VPS are handed over already updated from a clean official ISO — keeping them updated afterwards is the next step.

Tüm makaleler

Sitenizi yayına alalım

Bir paket seçin ya da bizi arayın — seçimde yardımcı olur, sitenizi ücretsiz taşırız.