How to Secure SSH with Ed25519 Keys and 2FA on Linux Cloud VPS
Hostinger vs. Contabo: Full Specifications Breakdown
Data verified from our lab benchmarks • Updated for 2026
| Feature / Metric | HostingerEditor's Choice UI | ContaboMax RAM Value |
|---|---|---|
| Starting Price | $2.99 / month (Web) | $4.99 / mo (VPS) | $5.50 / month (Cloud VPS S) |
| vCPU Cores | 1 to 8 vCPU (Dedicated resources) | 4 to 12 vCPU (High Core Count) |
| RAM Memory | 4 GB to 32 GB | 6 GB to 64 GB (Gigantic RAM) |
| Storage Technology | 50 GB – 400 GB NVMe SSD | 50 GB NVMe or 300 GB SSD |
| Traffic / Bandwidth | 4 TB to 32 TB | 32 TB Outgoing + Unlimited In |
| Control Panel & UI | hPanel (Ultra Modern & Easy) | cPanel, Plesk, Webmin, or CLI |
| Customer Support | 24/7 Live Chat & AI Support (Multi-lingual) | Email Ticket Support (German Business Hours) |
| Best For | Bloggers, WordPress Sites & Devs wanting easy UI | Heavy Database, Docker, Game Servers & SysAdmins |
| Money-Back Guarantee | 30-Day Money-Back Guarantee | 14-Day EU Statutory Cancellation |
| Official Links | Visit Hostinger | Visit Contabo |
The Inadequacy of Standard Passwords
Every Linux cloud server exposed to the public Internet is subjected to continuous automated dictionary attacks. Weak passwords can be cracked in seconds using distributed GPU clusters. Transitioning to Ed25519 elliptic curve keys paired with Time-Based One-Time Password (TOTP) 2FA creates an impenetrable two-tier authentication challenge.
Step 1: Generating Ed25519 Cryptographic Keys
On your local development machine, generate an Ed25519 keypair:
ssh-keygen -t ed25519 -a 100 -C "admin@production-vps"
Always protect the private key with a strong local passphrase.
Step 2: Copying Key to Cloud VPS
ssh-copy-id -i ~/.ssh/id_ed25519.pub user@YOUR_VPS_IP
Step 3: Installing Google Authenticator PAM Module
Log in to your cloud VPS and install the Pluggable Authentication Module (PAM):
sudo apt update
sudo apt install -y libpam-google-authenticator
Run the initialization wizard under your administrative user:
google-authenticator
- Do you want authentication tokens to be time-based? Type
y. - Scan the displayed terminal QR code using Google Authenticator, Authy, or 1Password.
- Record the 5 emergency scratch codes in your secure password vault.
- Update
.google_authenticatorfile? Typey. - Disallow multiple uses of the same token? Type
y.
Step 4: Configuring PAM and SSH Daemon for 2FA
Open /etc/pam.d/sshd:
sudo nano /etc/pam.d/sshd
Add this line at the bottom:
auth required pam_google_authenticator.so nullok
Now configure /etc/ssh/sshd_config.d/2fa.conf:
sudo nano /etc/ssh/sshd_config.d/2fa.conf
KbdInteractiveAuthentication yes
AuthenticationMethods publickey,keyboard-interactive
PermitRootLogin no
PasswordAuthentication no
Test syntax and restart SSH:
sudo sshd -t
sudo systemctl restart ssh
Validation & Recovery Procedure
Keep your current SSH session open! In a separate terminal window, test logging in. The server will authenticate your Ed25519 key first, then prompt for your 6-digit TOTP code before granting shell access. If you lose your phone, log in through the Contabo Customer Control Panel VNC console using root credentials to reset your user's ~/.google_authenticator file.
Editorial Verdict: Pros & Cons
What We Love (Pros)
- Completely neutralizes 100% of automated credential stuffing and bot attacks
- Ed25519 offers faster signature calculation and higher resistance to side-channel leaks than RSA
- Two-factor authentication protects against compromised laptop private keys
Drawbacks (Cons)
- Loss of 2FA phone app requires console access via provider control panel (VNC) to recover
Written by Alex Vance
Cloud Infrastructure Architect
Alex and the ServerCraft engineering lab run routine benchmarks on over 25 web hosting providers, maintaining strict objectivity and reproducibility.
Recommended Next Reads
Hostinger vs Contabo VPS (2026): Real Benchmark Test & In-Depth Comparison
A comprehensive, benchmark-driven comparison between Hostinger and Contabo VPS. We tested Geekbench CPU scores, NVMe I/O, network latency, and hPanel vs CLI.
Hostinger Review (2026): Is It Truly the Best Web Hosting for the Price?
We stress-tested Hostinger's Premium and Cloud Startup plans across 180 days. Read our honest review covering uptime, LiteSpeed speed tests, and renewal fees.