Knowledgebase | VPSGrid
English
EnglishBeta EspañolPortuguês (Brasil)Coming soonFrançaisComing soonDeutschComing soon
Client Area

How to Enable SSH Key Authentication

KB-043, Linux VPS, VPSGrid, unmanaged 0 found helpful

How to Enable SSH Key Authentication

Short answer

Generate an Ed25519 key pair, install the public key on the VPS (ssh-copy-id), confirm key login works, then disable password authentication carefully. Keep the private key secure and never share it.

Overview

SSH keys replace password logins with a public/private key pair. On an unmanaged VPSGrid Linux VPS, you generate the key on your workstation, install the public key on the server, then optionally lock down sshd to refuse passwords.

Generate a key pair

ssh-keygen -t ed25519 -C "vpsgrid-vps"

Install Public Key on VPS

ssh-copy-id root@YOUR_PRIMARY_IP

Test Key Login

ssh root@YOUR_PRIMARY_IP should not prompt for password if key has no passphrase.

Warning

Keep private key secure. Never share id_ed25519 private file.

SSH Connection Flow Your PC InternetTCP 22 VPSGrid VPS Linux Shell ssh root@YOUR_PRIMARY_IP → key or password auth
Diagram: Connect on port 22 using the primary IP from My Services.

Harden your VPS on day one: apply OS updates, configure a guest firewall, use SSH keys on Linux, and restrict RDP exposure on Windows. Review How to Secure Your Linux VPS After First Login and Windows Firewall Basics for VPSGrid Windows VPS before loading production data.

Passphrase Best Practice

Use a passphrase on your private key. Store keys in ssh-agent for convenience.

Permissions

On server: chmod 700 ~/.ssh && chmod 600 ~/.ssh/authorized_keys.

Why SSH Is the Primary Admin Path

SSH provides encrypted command-line access suitable for automation, file transfer (scp/sftp), and tunneling. Compared to noVNC, SSH uses less bandwidth and supports scripted deployments. Compared to control panels, SSH avoids licensing overhead for experienced administrators managing LAMP, LEMP, or Docker stacks.

Time Sync and Logs

Configure NTP (systemd-timesyncd or chrony) so log timestamps align with your local timezone investigations. Centralize logs off-server when running production → unmanaged VPS plans do not include long-term log retention.

Key Types

ed25519 keys are modern and compact. RSA 4096 remains acceptable for legacy systems. Avoid DSA keys.

Agent Forwarding

Disable agent forwarding unless you understand the security tradeoffs → never forward agents through untrusted jump hosts.

Revocation

Remove compromised keys from authorized_keys immediately. Rotating keys annually is reasonable for production servers.

SSH key notes

  • Linux administration on VPSGrid assumes comfort with shell, package managers, and log files — control panels are optional third-party add-ons you install and license
  • Schedule cron jobs in UTC or explicitly set /etc/localtime to avoid daylight-saving surprises for batch jobs
  • Combine SSH key auth with firewall allowlists if your office has static egress IP addresses

Frequently Asked Questions

Disable password auth?

Only after confirming key login works → edit /etc/ssh/sshd_config PasswordAuthentication no.

Multiple keys?

Append multiple public keys to authorized_keys → one per line.

Related Articles

Need More Help?

Search this knowledgebase for related guides. If the issue persists, open a ticket at billing.vpsgrid.net with your service ID, primary IP, and steps already tried. See What Information to Include in a Support Request and Security Responsibilities on Unmanaged VPS for scope and required details.

Was this answer helpful?

Related Articles