ANAYIL GROUPHosting · My Domains Submit a Ticket
Help center
HomeLinux VPS and StorageAdd and rotate SSH keys on a VPS
Linux VPS and Storage5–8 min•Difficulty: Avanzado

Add and rotate SSH keys on a VPS

Test a new key before removing the old one and protect recovery access.

Documentación técnica AnayilUpdated: 2026-10-11

Apply this guide to your situation

This answer covers “Add and rotate SSH keys on a VPS”. Read it with the summary and confirm that the symptom and service match what you are experiencing. Available options can vary by plan and account setup.

  • Before changing anything, note what you expected, what happened and roughly when. Check whether the issue affects one page or the whole service.
  • Save the full error message and note recent changes. Hide passwords, access codes, personal data and keys before sharing screenshots or logs.
  • If a step requires administrator access, restarting services or editing server files, stop if you do not administer that server. Send support the service name, error and checks you have already made.

Likely-cause and resolution matrix

Follow a branch only when evidence supports it. A symptom may have more than one cause; do not change layers by guesswork.

01Professional English translation pending.

Why it can happen: Professional English translation pending.

How to diagnose (read-only):
bash
Professional English translation pending.

Step-by-step resolution:
Professional English translation pending.

02Professional English translation pending.

Why it can happen: Professional English translation pending.

How to diagnose (read-only):
bash
Professional English translation pending.

Step-by-step resolution:
Professional English translation pending.

03Professional English translation pending.

Why it can happen: Professional English translation pending.

How to diagnose (read-only):
bash
Professional English translation pending.

Step-by-step resolution:
Professional English translation pending.

04Professional English translation pending.

Why it can happen: Professional English translation pending.

How to diagnose (read-only):
bash
Professional English translation pending.

Step-by-step resolution:
Professional English translation pending.

05Professional English translation pending.

Why it can happen: Professional English translation pending.

How to diagnose (read-only):
bash
Professional English translation pending.

Step-by-step resolution:
Professional English translation pending.

Prerequisites

  • Authorised service access and confirmation of the exact product/plan.
  • A recent backup or export before changing data, storage or DNS.

Important warnings

  • Paths and features vary by provider and plan. This documentation does not claim cPanel, Plesk, Titan or these external modules are integrated into Anayil Panel.
  • Do not share passwords, private keys, tokens or personal data in screenshots or tickets.

Step-by-step walkthrough

1. Identify the product and preserve its current state

Generate an individual key with a passphrase and record its fingerprint; do not reuse a shared key.

2. Follow the procedure with minimal changes

Add the public key for the correct user and test a second SSH session before removing the old key.

3. Verify the result before closing

If exposure is suspected, revoke the affected key, inspect SSH logs and rotate credentials/tokens that shared access.

Troubleshooting & Solutions

`Permission denied (publickey)` on connection.

Root cause: Wrong user or identity, missing public key or unsafe `.ssh` directory permissions.

Resolution: Confirm user/fingerprint and run `ssh -i key user@host -v` for diagnosis. Have the administrator check permissions; do not enable root password access as a shortcut.

Rollback and recovery plan

If verification fails, stop further changes, preserve logs and restore only a confirmed previous copy or value. For managed services, ask the provider to roll back the layer it owns.

Related runbooks in this category:

Was this technical guide helpful?

Facing a production outage?

Hosting Anayil system administrators can directly intervene on your server infrastructure.

Open Support Ticket at Hosting Anayil