Secure, Passwordless Access with SSH Keys
Managing your Linux VPS or dedicated server demands robust security, and SSH key authentication is the gold standard for secure, passwordless access. Unlike traditional passwords, SSH keys use strong encryption to provide faster, safer logins, ideal for both manual access and automated workflows. For example, setting up SSH keys for your ava.hosting VPS ensures secure access to your web server while enabling seamless integration with tools like Git or Ansible. This guide walks you through generating, adding, and using SSH keys for new or existing servers, optimized for ava.hosting’s high-performance infrastructure.
What Is an SSH Key and Why Use It?
An SSH key pair consists of two parts:
- Public key: saved on the server
- Private key: kept securely on your local device
When you connect via SSH, your system proves it holds the private key, and the server grants access — no password needed.
Benefits of Using SSH Keys:
| Feature | Benefit |
|---|---|
| Strong encryption | Near-impossible to brute-force |
| No password storage | Eliminates risk of leaked or reused passwords |
| Faster login | Instant authentication |
| Automation friendly | Ideal for scripts, Git, Ansible, CI/CD tools |
Option 1: Add SSH Key When Creating a New VPS
You can add your SSH key during the VPS creation process — it’s fast and secure.
Steps:
- Log in to your hosting provider’s control panel and start the VPS setup process
- Locate the SSH Key or Authorized Keys section
- Paste your public key (see below how to generate it)
- Complete the deployment — once the VPS is live, you can log in via SSH without a password
💡 You can add multiple keys if multiple users or devices need access.
Option 2: Add SSH Key to an Existing VPS
Already have a running server? Here’s how to manually add your public key:
Step 1: Generate an SSH Key (if you don’t have one)
On your local machine (Linux/macOS/WSL/Windows Terminal):
- Press Enter to confirm the default file location
- Enter a passphrase for additional protection (optional)
Step 2: Copy the Public Key
Use this command to display your public key:
Or copy it directly to your VPS:
Replace username (usually root) and your-server-ip.
Step 3: Manual Method (Optional)
If ssh-copy-id is unavailable, log in with a password and run:
Paste your public key, save the file, then:
Done — you can now log in without entering a password.
⚙ How to Use the SSH Key to Connect
Once your public key is on the server, connect like this:
If you saved your key under a custom filename:
Where Are SSH Keys Stored?
| Location | Purpose |
|---|---|
| ~/.ssh/id_ed25519 | Your private key (keep secure!) |
| ~/.ssh/id_ed25519.pub | Public key (safe to share) |
| /root/.ssh/authorized_keys | VPS location for access |
Security Tip: Disable Password Logins
For extra protection, disable password authentication entirely:
- Edit SSH config:
nano /etc/ssh/sshd_config - Change:
PasswordAuthentication no
PermitRootLogin prohibit-password - Restart SSH:
systemctl restart sshd
⚠ Only do this once your key login is confirmed working.
Conclusion
SSH key authentication is the cornerstone of secure, passwordless access to your ava.hosting VPS or dedicated server. By eliminating password vulnerabilities and enabling fast, encrypted logins, SSH keys are ideal for both manual management and automated workflows. For example, you can use SSH keys to securely deploy updates to a Node.js app on your server or automate backups with rsync. With this guide you can set up SSH keys in minutes, ensuring a secure, scalable, and efficient server management experience.


