How to Set Up SSH Keys on Your VPS Server (Secure Login Without Passwords)

How to Set Up SSH Keys on Your VPS Server (Secure Login Without Passwords)

Logging into your VPS server using a password is a bit like using the same key for every door in your house. It works — but if someone gets hold of it, everything is at risk.

That’s why security-focused businesses are switching to SSH key authentication.

At CreativeON, trusted by businesses across Pakistan, we help clients set up secure, password-free SSH access for their VPS servers. Whether you’re managing a Linux VPS, Windows VPS, or multiple servers at once, SSH keys make access faster, safer, and more reliable.

In this guide, I’ll walk you through:

  • What SSH keys are (in simple terms)
  • How to generate SSH keys
  • How to add them to your VPS server
  • How to manage multiple keys
  • Common problems and fixes
  • Extra security best practices for VPS hosting in Pakistan

SSh Keys (creativeon)

What Are SSH Keys (And Why Are They Safer Than Passwords)?

SSH keys replace traditional passwords with a pair of cryptographic keys:

  • Public key → Stored on your VPS server
  • Private key → Stored securely on your computer

When you connect, the server checks whether your private key matches the public key it already trusts. If it does, you’re logged in — no password required.

Why SSH keys are more secure

  • Passwords can be guessed or brute-forced
  • SSH keys are nearly impossible to crack
  • You don’t send credentials over the network
  • Ideal for remote teams and system admins

Think of it like this:
You give your server a lock (public key), but only you own the matching key (private key).

What You Need Before You Start

To set up SSH key login, you’ll need:

  • A VPS server (Linux or Windows)
  • SSH access enabled
  • A computer running:
    • macOS or Linux (built-in terminal)
    • Windows (OpenSSH or PuTTY)

If you’re using VPS hosting from CreativeON, SSH access is available by default — making it easy to secure your server right away.

Tools by platform

  • Linux / macOS → Terminal
  • Windows → OpenSSH (recommended) or PuTTY + Pageant

No extra hardware, no advanced skills required.

Step 1: Generate Your SSH Key Pair

Open your terminal (or PowerShell on Windows) and run:

ssh-keygen -t ed25519

What happens next?

  • Press Enter to accept the default location
  • Set a strong passphrase (recommended)

This creates two files in your .ssh folder:

  • id_ed25519Private key (never share this)
  • id_ed25519.pubPublic key (safe to upload to server)

🔐 Security tip:
Treat your private key like your wallet. If someone gets it, they get access.

Step 2: Add the Public Key to Your VPS Server

Now we tell the server to trust your key.

Option 1: Using ssh-copy-id (Linux / macOS)

ssh-copy-id user@your-server-ip

Option 2: Manual method (All platforms)

Open the public key file:

cat ~/.ssh/id_ed25519.pub

  1.  
  2. Copy the output

Paste it into:

~/.ssh/authorized_keys

  1.  on your VPS server

Correct permissions (important!)

chmod 700 ~/.ssh

chmod 600 ~/.ssh/authorized_keys

Step 3: Test Your SSH Login

Now test your connection:

ssh user@your-server-ip

If everything is set up correctly, you’ll log in without entering a password.

You’re now securely connected to your VPS — whether you’re working from Lahore, Karachi, or anywhere in the world.

(Highly Recommended) Disable Password Login on Your VPS

SSH keys are secure — but disabling password login makes your VPS dramatically safer.

Edit the SSH config file:

sudo nano /etc/ssh/sshd_config

Change:

PasswordAuthentication yes

to:

PasswordAuthentication no

Restart SSH:

sudo systemctl restart ssh

🚫 This blocks brute-force attacks completely.

Managing Multiple SSH Keys (For Multiple VPS Servers)

If you manage more than one VPS, SSH agents save time.

Use SSH Agent

eval “$(ssh-agent -s)”

ssh-add ~/.ssh/id_ed25519

Create labeled keys

ssh-keygen -t ed25519 -f ~/.ssh/project-name

On Windows

  • Use Pageant (PuTTY’s SSH agent)
  • Or OpenSSH with ssh-add

This setup is ideal for developers, agencies, and IT teams managing multiple servers.

Common SSH Problems & How to Fix Them

❌ Permission denied (publickey)

Ensure your public key is inside:

~/.ssh/authorized_keys

  •  
  • Check permissions:
    • .ssh700
    • authorized_keys600

❌ Lost your private key?

  • Remove the old public key from the server
  • Generate a new SSH key pair
  • Add the new public key

If you’re stuck, CreativeON’s support team can help — just like we do for media houses, healthcare labs, and enterprise clients across Pakistan.

Extra Security Tips for VPS Hosting

  • ✅ Always use Ed25519 keys
  • 🔄 Rotate SSH keys yearly
  • 🧑‍💻 Use one key per user
  • 🔐 Combine SSH with firewall rules
  • 🌐 Pair VPS security with:
    • Secure .PK domains (PKNIC Gold Partner)
    • Google Workspace (official reseller)

Think of it as upgrading from a basic lock to a full smart security system.

Final Recap

Here’s what you’ve learned:

  • Generate SSH keys
  • Add the public key to your VPS
  • Disable password login
  • Manage multiple keys safely
  • Fix common SSH issues

You’re now using secure, modern SSH authentication — the right way to manage a VPS server.

If you’re planning to buy VPS in Pakistan, or want help securing your existing server, CreativeON offers reliable, affordable VPS hosting with expert support.

The author
Asher Feroze

I’m Asher Feroze, and I’ve been part of CreativeON for several years, working in various roles including Manager Operations, Business Development Manager, and technical support for our web hosting services. Over time, I’ve gained deep insights into both the business and technical sides of the industry. Now, I use that experience to write informative articles for CreativeON, Gworkspace, and gworkspacepartner.pk, helping readers make smart choices when it comes to web hosting and Google Workspace solutions.

Table of Contents

bonus new member

situs slot gacor

spaceman slot