Logo

Configure SSH Key on Linux VPS

Configure SSH Key on Linux VPS

Complete guide to configure SSH key authentication on your Linux VPS. Detailed tutorial for Windows (PuTTY), Linux and macOS. Secure your VeryCloud server with SSH keys.

Configure SSH Key on Linux VPS

Introduction to SSH Keys

SSH keys (Secure Shell) offer a much more secure authentication method than traditional passwords. Instead of typing a password with each connection, you use a pair of cryptographic keys:

  • Private key: Stays on your local computer (never share it)
  • Public key: Installed on the VPS server

When you connect, the server verifies that your private key matches the registered public key. If the match is validated, you are authenticated instantly.

How it Works

┌─────────────────────┐                    ┌─────────────────────┐
│  Your PC            │                    │  VeryCloud VPS      │
│                     │                    │                     │
│  🔑 Private key     │◄────SSH Auth────►  │  🔓 Public key      │
│  (id_rsa)           │                    │  (authorized_keys)  │
│                     │   ✅ Automatic     │                     │
└─────────────────────┘   connection       └─────────────────────┘

SSH Keys Advantages

AspectPasswordSSH Key
SecurityVulnerable to brute-force attacksNearly impossible to crack
ConvenienceManual entry each connectionAutomatic connection
SharingRisk if disclosedPublic key shareable safely
LengthTypically 8-20 characters2048-4096 bits encryption
AutomationDifficult to scriptIdeal for scripts

🖥️ Method 1: Generate SSH Key on Windows with PuTTY

Step 1: Download PuTTY and PuTTYgen

PuTTY is the most popular SSH client for Windows. PuTTYgen is the included key generation utility.

  1. Go to the official website: https://www.putty.org/
  2. Download the MSI installation package (64-bit or 32-bit depending on your system)
  3. Install PuTTY - PuTTYgen will be automatically included

💡 VeryCloud Tip: You can also download only puttygen.exe if you already have PuTTY installed.

Step 2: Launch PuTTYgen

  1. Open PuTTYgen via:
    • Start MenuAll ProgramsPuTTYPuTTYgen
    • Or double-click on puttygen.exe
  2. The key generation interface displays with the following options:
    • Key type (RSA, DSA, ECDSA, Ed25519, SSH-1)
    • Number of bits for generation
    • "Generate" button to create a new key

Step 3: Configure Settings

Before generating the key, verify the settings at the bottom of the window:

ParameterRecommended ValueDescription
Type of keyRSA or EdDSA (Ed25519)Encryption algorithm
Number of bits4096 (RSA) or 256 (Ed25519)Key length

💡 VeryCloud Recommendation: For maximum security, choose RSA 4096 bits or EdDSA (Ed25519) which is more modern and performant.

Algorithm Choice Diagram:

Available Algorithms:

┌─────────────────────────────────────────┐
│  RSA 4096 bits                          │
│  ✅ Universally compatible              │
│  ✅ Proven security                     │
│  ⚠️  Larger keys                        │
└─────────────────────────────────────────┘

┌─────────────────────────────────────────┐
│  EdDSA (Ed25519)                        │
│  ✅ Modern and fast                     │
│  ✅ Compact keys                        │
│  ✅ Recommended for new servers         │
└─────────────────────────────────────────┘

Step 4: Generate the Key Pair

  1. Click the Generate button
  2. Important: Move your mouse randomly in the empty area under "Please generate some randomness by moving the mouse over the blank area" to generate entropy (cryptographic randomness)
  3. Wait for the progress bar to complete

Generation Process:

Generating...
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 45%

Move your mouse randomly
to generate entropy...

Step 5: Configure and Save Keys

Once the key is generated, you will see:

  • A text area with your public key (OpenSSH format)
  • "Key fingerprint" and "Key comment" fields
  • "Key passphrase" and "Confirm passphrase" fields
  • "Save public key" and "Save private key" buttons

The passphrase adds an extra security layer. Even if someone obtains your private key, they cannot use it without the passphrase.

  1. In Key passphrase, enter a strong secret phrase
  2. Confirm in Confirm passphrase

🔒 Security Advice: Use a phrase of 12+ characters with uppercase, lowercase, numbers, and symbols.

Strong Passphrase Example:

Bad : password123
Good: My VeryCloud VPS 2026!

Save the Private Key

  1. Click Save private key
  2. Choose a secure location (e.g., Documents/SSH_Keys/)
  3. Name the file (e.g., verycloud_vps.ppk)

⚠️ IMPORTANT: The .ppk file (PuTTY Private Key) must remain confidential and never be shared.

Save the Public Key

  1. Click Save public key
  2. Name the file (e.g., verycloud_vps.pub)

Copy the Public Key in OpenSSH Format

Important: For Linux servers, you must copy the key in OpenSSH format:

  1. Select all text in the "Public key for pasting into OpenSSH authorized_keys file" area
  2. Copy it (Ctrl+C)
  3. Keep it aside for server installation

OpenSSH Format:

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDx... rsa-key-20260130

Step 6: Configure PuTTY to Use the Key

  1. Open PuTTY
  2. In the left menu, navigate to: ConnectionSSHAuthCredentials
  3. Click Browse next to "Private key file for authentication"
  4. Select your .ppk file
  5. Return to Session, enter your VeryCloud VPS IP and save the session

Complete PuTTY Configuration:

┌──────────────────────────────────┐
│ Session Settings                 │
├──────────────────────────────────┤
│ Host Name: 51.91.XXX.XXX        │
│ Port: 22                         │
│ Connection type: SSH             │
├──────────────────────────────────┤
│ Connection > SSH > Auth >        │
│ Credentials                      │
│ Private key: verycloud_vps.ppk  │
└──────────────────────────────────┘

🐧 Method 2: Generate SSH Key on Linux/macOS

Step 1: Open Terminal

  • Linux: Ctrl+Alt+T or search "Terminal" in your applications
  • macOS: Applications → Utilities → Terminal

Step 2: Generate the Key Pair

Option A: RSA 4096 bits key (universally compatible)

ssh-keygen -t rsa -b 4096 -C "[email protected]"

Option explanation:

  • -t rsa: Algorithm type (RSA)
  • -b 4096: Key length (4096 bits)
  • -C: Comment (your email to identify the key)
ssh-keygen -t ed25519 -C "[email protected]"

Ed25519 Advantages:

✅ Faster than RSA
✅ Smaller keys (256 bits vs 4096)
✅ Equivalent security with fewer bits
✅ Faster generation
✅ Recommended by security experts

Step 3: Follow Instructions

Console output:

Generating public/private ed25519 key pair.
Enter file in which to save the key (/home/user/.ssh/id_ed25519):
  1. Location: Press Enter to accept default location (~/.ssh/id_ed25519)
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
  1. Passphrase: Enter a secret phrase (recommended) or press Enter for none

Generation Result:

Your identification has been saved in /home/user/.ssh/id_ed25519
Your public key has been saved in /home/user/.ssh/id_ed25519.pub
The key fingerprint is:
SHA256:AbCdEfGh1234567890... [email protected]
The key's randomart image is:
+--[ED25519 256]--+
|        .o.      |
|       . .o      |
|        o  +     |
|       . .. o    |
|      . S  . .   |
|     . o =  .    |
|      o * +.     |
|     . = Bo+.    |
|      o.=X*=E    |
+----[SHA256]-----+

Step 4: Verify Creation

ls -la ~/.ssh/

Expected output:

drwx------  2 user user 4096 Jan 30 10:00 .
drwxr-xr-x 25 user user 4096 Jan 30 10:00 ..
-rw-------  1 user user  464 Jan 30 10:00 id_ed25519        # Private key
-rw-r--r--  1 user user  102 Jan 30 10:00 id_ed25519.pub    # Public key

Step 5: Display the Public Key

cat ~/.ssh/id_ed25519.pub

Result:

ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAbCdEfGh... [email protected]

📋 Important: Copy this complete line for server installation.


🚀 Install Public Key on VeryCloud VPS

Process Overview

┌──────────────────────────────────────────────────────────┐
│                 Key Installation                          │
├──────────────────────────────────────────────────────────┤
│                                                           │
│  1. Copy public key from your PC                        │
│          ↓                                               │
│  2. Connect to VeryCloud VPS (SSH)                      │
│          ↓                                               │
│  3. Create ~/.ssh directory                             │
│          ↓                                               │
│  4. Add key to authorized_keys                          │
│          ↓                                               │
│  5. Set correct permissions                             │
│          ↓                                               │
│  6. Test connection                                      │
│                                                           │
└──────────────────────────────────────────────────────────┘

The ssh-copy-id command automates installation:

ssh-copy-id -i ~/.ssh/id_ed25519.pub root@VPS_IP

Example with VeryCloud VPS:

ssh-copy-id -i ~/.ssh/id_ed25519.pub [email protected]

Console output:

/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/user/.ssh/id_ed25519.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s)
[email protected]'s password: [enter your password]

Number of key(s) added: 1

Now try logging into the machine with:   "ssh '[email protected]'"
and check to make sure that only the key(s) you wanted were added.

Success: The key is now installed!

Method 2: Manual Installation

If ssh-copy-id is not available or from Windows:

Step 1: Connect to VPS with password

ssh [email protected]

First connection:

The authenticity of host '51.91.123.456' can't be established.
ED25519 key fingerprint is SHA256:AbCdEfGh1234567890...
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '51.91.123.456' (ED25519) to the list of known hosts.
[email protected]'s password: [enter your password]

Step 2: Create .ssh directory (if needed)

mkdir -p ~/.ssh
chmod 700 ~/.ssh

Permission explanation:

chmod 700 = rwx------
         ↑
         Only owner can read/write/execute
         
drwx------ = directory (d) + read/write/execute (rwx) owner only

Step 3: Create/edit authorized_keys file

nano ~/.ssh/authorized_keys

Step 4: Paste the public key

Paste the previously copied public key (single line).

Expected format in file:

ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAbCdEfGh... [email protected]
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC... [email protected]

💡 Tip: You can have multiple keys (one per line) for different computers.

Nano commands:

Ctrl+X  : Exit
Y       : Confirm save
Enter   : Validate filename

Step 5: Save and set permissions

# Save in nano: Ctrl+X, then Y, then Enter

# Set permissions
chmod 600 ~/.ssh/authorized_keys

Permission structure:

~/.ssh/                      → 700 (drwx------)
~/.ssh/authorized_keys       → 600 (-rw-------)

Permissions explained:
700 = rwx------ (owner: read/write/execute)
600 = rw------- (owner: read/write only)

Step 6: Test connection

Disconnect and reconnect:

exit
ssh [email protected]

If everything works:

Welcome to Ubuntu 24.04 LTS (GNU/Linux 6.8.0-51-generic x86_64)

 * VeryCloud VPS - Telehouse Paris Datacenter
 * Netrix Anti-DDoS Protection active
 * 24/7 Support: https://manager.verycloud.fr

Last login: Thu Jan 30 10:30:45 2026 from 91.123.45.67
root@vps-verycloud:~#

Connection successful without password!

Method 3: Single Command (from your local PC)

cat ~/.ssh/id_ed25519.pub | ssh [email protected] "mkdir -p ~/.ssh && chmod 700 ~/.ssh && cat >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys"

This command chains all steps automatically:

  1. Reads your local public key
  2. Connects to the server
  3. Creates the .ssh directory
  4. Adds the key to authorized_keys
  5. Sets correct permissions

🔒 Secure SSH Server

Once SSH keys are configured, strengthen security by disabling password authentication.

Security Diagram

Before                         After
┌─────────────────┐           ┌─────────────────┐
│ SSH accepts:    │           │ SSH accepts:    │
│ ✅ Passwords    │    ═══>   │ ❌ Passwords    │
│ ✅ SSH Keys     │           │ ✅ SSH Keys     │
└─────────────────┘           └─────────────────┘
   Vulnerable                   Secured
   (brute-force attacks)        (maximum protection)

Step 1: Edit SSH Configuration

sudo nano /etc/ssh/sshd_config

Step 2: Modify Settings

Search and modify these lines (use Ctrl+W to search):

# Disable password authentication
PasswordAuthentication no

# Disable empty passwords
PermitEmptyPasswords no

# Enable public key authentication
PubkeyAuthentication yes

# Disable challenge-response authentication
ChallengeResponseAuthentication no

# Optional: Disable root login (create sudo user first)
# PermitRootLogin prohibit-password

Security Options Table:

ParameterValueDescription
PasswordAuthenticationnoDisables passwords
PubkeyAuthenticationyesEnables SSH keys
PermitRootLoginprohibit-passwordRoot only with SSH key
PermitEmptyPasswordsnoForbids empty passwords
ChallengeResponseAuthenticationnoDisables interactive auth

Step 3: Restart SSH Service

sudo systemctl restart sshd

Verify status:

sudo systemctl status sshd

Expected output:

● ssh.service - OpenBSD Secure Shell server
     Loaded: loaded (/lib/systemd/system/ssh.service; enabled)
     Active: active (running) since Thu 2026-01-30 10:45:23 UTC; 5s ago

⚠️ CRITICAL WARNING: Keep an SSH session open during tests! If configuration is incorrect, you could lose access. You can always access via VNC console in your VeryCloud client area.

Security procedure:

1. Open 2 SSH sessions
2. Test key connection in session #2
3. If it works, modify config
4. Restart SSH
5. Test session #2 again
6. If success, close session #1

🛠️ SSH Key Management

Add Multiple Keys

You can authorize multiple keys (multiple computers, multiple users):

nano ~/.ssh/authorized_keys

Example file with multiple keys:

# Personal laptop
ssh-ed25519 AAAAC3... user@personal-laptop

# Office PC
ssh-rsa AAAAB3... user@office-pc

# Backup server
ssh-ed25519 AAAAC3... backup@server

# DevOps team key
ssh-rsa AAAAB3... [email protected]

Remove a Key

Edit authorized_keys and delete the corresponding line:

nano ~/.ssh/authorized_keys
# Delete the line
# Save: Ctrl+X, Y, Enter

Change Passphrase of Existing Key

ssh-keygen -p -f ~/.ssh/id_ed25519

Interactive process:

Enter old passphrase: [old passphrase]
Enter new passphrase: [new passphrase]
Enter same passphrase again: [confirmation]
Your identification has been saved with the new passphrase.

Display Key Fingerprint

ssh-keygen -lf ~/.ssh/id_ed25519.pub

Output:

256 SHA256:AbCdEfGh1234567890KLMNOPqrstUVWXyz01234 [email protected] (ED25519)
 ↑      ↑                                    ↑              ↑
Bits  Hash                                Comment        Type

List All Authorized Keys on Server

cat ~/.ssh/authorized_keys

or for a more readable view:

while read -r line; do 
  echo "$line" | ssh-keygen -lf /dev/stdin
done < ~/.ssh/authorized_keys

🔄 Convert Key Formats

Format Diagram

┌──────────────┐      Conversion      ┌──────────────┐
│ PPK Format   │ ◄═════════════════► │ OpenSSH      │
│ (PuTTY)      │                      │ Format       │
│              │                      │ (Linux/Mac)  │
│  Windows     │                      │  Unix-like   │
└──────────────┘                      └──────────────┘

PPK to OpenSSH (PuTTY → Linux)

In PuTTYgen:

  1. Click Load
  2. Select your .ppk file
  3. Go to ConversionsExport OpenSSH key
  4. Save the file (e.g., id_rsa without extension)

Result: Key compatible with Linux/macOS

OpenSSH to PPK (Linux → PuTTY)

In PuTTYgen:

  1. Go to ConversionsImport key
  2. Select your OpenSSH private key (id_rsa or id_ed25519)
  3. (Optional) Add a passphrase
  4. Click Save private key
  5. Save as .ppk

Result: Key compatible with PuTTY on Windows


🔧 Troubleshooting

Error: "Permission denied (publickey)"

Complete message:

[email protected]: Permission denied (publickey).

Possible causes:

  1. ❌ Public key not installed on server
  2. ❌ Wrong permissions on .ssh or authorized_keys
  3. ❌ Incorrect private key used
  4. ❌ SELinux blocking access (CentOS/RHEL)

Solutions:

# On VeryCloud server
# 1. Check permissions
ls -ld ~/.ssh
ls -l ~/.ssh/authorized_keys

# Fix if necessary
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys

# 2. Verify key is present
cat ~/.ssh/authorized_keys

# 3. Check SSH logs
sudo tail -20 /var/log/auth.log
# or on some systems
sudo journalctl -u sshd -n 20

# 4. Verify SSH configuration
sudo grep -E "PubkeyAuthentication|PasswordAuthentication" /etc/ssh/sshd_config

Detailed diagnostic from your PC:

# Verbose connection (3 levels)
ssh -vvv [email protected]

# You will see:
# - Keys attempted
# - Algorithms proposed
# - Exact reason for rejection

Error: "Connection refused"

Complete message:

ssh: connect to host 51.91.123.456 port 22: Connection refused

Possible causes:

  • ❌ SSH service not started
  • ❌ Firewall blocking port 22
  • ❌ Incorrect IP
  • ❌ SSH port changed (no longer 22)

Solutions:

# On server (via VeryCloud VNC console)
# 1. Check SSH status
sudo systemctl status sshd

# 2. Start SSH if stopped
sudo systemctl start sshd

# 3. Enable at boot
sudo systemctl enable sshd

# 4. Check firewall
sudo ufw status
sudo ufw allow 22/tcp

# 5. Verify SSH is listening
sudo ss -tlnp | grep :22
# Should display: LISTEN ... sshd

# 6. Check configured SSH port
sudo grep "^Port" /etc/ssh/sshd_config

VeryCloud Verification:

  • Log in to VeryCloud client area
  • Verify VPS is started (status "Running")
  • Use VNC console if SSH doesn't work

Error: "Host key verification failed"

Complete message:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Host key verification failed.

Cause: Server changed (OS reinstallation, new IP, MITM attack)

Solution if legitimate (reinstallation):

# Remove old entry
ssh-keygen -R 51.91.123.456

or

# Edit manually
nano ~/.ssh/known_hosts
# Delete line corresponding to IP

Security verification:

# Check fingerprint via VeryCloud VNC console
ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub

Passphrase Asked Every Connection

Solution: Use ssh-agent to remember passphrase

# Start agent
eval "$(ssh-agent -s)"

# Add key
ssh-add ~/.ssh/id_ed25519

# Verify
ssh-add -l

Output:

Agent pid 12345
Identity added: /home/user/.ssh/id_ed25519 ([email protected])
256 SHA256:AbCdEfGh... [email protected] (ED25519)

To make permanent (Linux/macOS):

Add to ~/.bashrc or ~/.zshrc:

# Auto-start SSH agent
if [ -z "$SSH_AUTH_SOCK" ]; then
   eval "$(ssh-agent -s)"
   ssh-add ~/.ssh/id_ed25519 2>/dev/null
fi

Error: "Too many authentication failures"

Message:

Received disconnect from 51.91.123.456: Too many authentication failures

Cause: Too many keys tried (default limit: 6)

Solution:

# Specify exact key
ssh -i ~/.ssh/id_ed25519 [email protected]

# Or configure in ~/.ssh/config
nano ~/.ssh/config

Add:

Host verycloud
    HostName 51.91.123.456
    User root
    IdentityFile ~/.ssh/id_ed25519
    IdentitiesOnly yes

Use: ssh verycloud


📋 Command Summary

Key Generation

ActionCommand
Generate RSA 4096 keyssh-keygen -t rsa -b 4096 -C "[email protected]"
Generate Ed25519 keyssh-keygen -t ed25519 -C "[email protected]"
Change passphrasessh-keygen -p -f ~/.ssh/id_ed25519
View fingerprintssh-keygen -lf ~/.ssh/id_ed25519.pub
View MD5 fingerprintssh-keygen -lf ~/.ssh/id_ed25519.pub -E md5

Server Installation

ActionCommand
Copy key (auto)ssh-copy-id -i ~/.ssh/id_ed25519.pub user@IP
Display public keycat ~/.ssh/id_ed25519.pub
Create .ssh directorymkdir -p ~/.ssh && chmod 700 ~/.ssh
Set permissionschmod 600 ~/.ssh/authorized_keys
Manual copycat ~/.ssh/id_ed25519.pub | ssh user@IP "cat >> ~/.ssh/authorized_keys"

Diagnostic and Maintenance

ActionCommand
Test verbose connectionssh -vvv user@IP
Check SSH servicesudo systemctl status sshd
Restart SSHsudo systemctl restart sshd
View SSH logssudo tail -f /var/log/auth.log
Remove known hostssh-keygen -R IP
List loaded keysssh-add -l
Test SSH configsudo sshd -t

📁 SSH File Structure

~/.ssh/
├── authorized_keys      # Authorized public keys (server)
├── id_ed25519          # Ed25519 private key (client)
├── id_ed25519.pub      # Ed25519 public key (client)
├── id_rsa              # RSA private key (client)
├── id_rsa.pub          # RSA public key (client)
├── known_hosts         # Known servers fingerprints
├── config              # Custom configuration (optional)
└── authorized_keys2    # Legacy file (not normally used)

Permission Diagram

File/Directory            Permission    Meaning
──────────────────────────────────────────────────────
~/.ssh/                   700          drwx------
                                       Only user can RWX

authorized_keys           600          -rw-------
                                       Only user can RW

id_ed25519 (private)      600          -rw-------
                                       Protected private key

id_ed25519.pub            644          -rw-r--r--
                                       Public, all can read

known_hosts               644          -rw-r--r--
                                       Known servers list

config                    600          -rw-------
                                       Personal config

Permission Commands

# Fix all SSH permissions
chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_*
chmod 644 ~/.ssh/id_*.pub
chmod 600 ~/.ssh/authorized_keys
chmod 644 ~/.ssh/known_hosts
chmod 600 ~/.ssh/config 2>/dev/null

💡 VeryCloud Best Practices

Security

✅ SSH Security Checklist

┌─────────────────────────────────────────┐
│ 1. Use Ed25519 or RSA 4096 bits        │
│ 2. ALWAYS add a passphrase             │
│ 3. NEVER share the private key         │
│ 4. Backup your keys securely           │
│ 5. Different keys per environment      │
│ 6. Disable password authentication     │
│ 7. Audit authorized_keys regularly     │
│ 8. Renew keys annually                 │
│ 9. Use ssh-agent                       │
│10. Configure ~/.ssh/config             │
└─────────────────────────────────────────┘

Advanced SSH Configuration (~/.ssh/config)

Create a configuration file to simplify your connections:

nano ~/.ssh/config

Example configuration:

# VeryCloud Production VPS
Host verycloud-prod
    HostName 51.91.123.456
    User root
    IdentityFile ~/.ssh/verycloud_prod_ed25519
    Port 22
    ServerAliveInterval 60
    ServerAliveCountMax 3

# VeryCloud Development VPS
Host verycloud-dev
    HostName 51.91.123.789
    User admin
    IdentityFile ~/.ssh/verycloud_dev_ed25519
    Port 22

# Global configuration
Host *
    AddKeysToAgent yes
    IdentitiesOnly yes
    HashKnownHosts yes

Simplified usage:

# Instead of
ssh [email protected]

# Simply use
ssh verycloud-prod

Automation and Scripts

Automatic backup script:

#!/bin/bash
# backup_vps.sh

VPS="verycloud-prod"
BACKUP_DIR="/home/backup/vps"
DATE=$(date +%Y%m%d_%H%M%S)

# Create backup
ssh $VPS "tar -czf /tmp/backup_$DATE.tar.gz /var/www /etc"

# Download
scp $VPS:/tmp/backup_$DATE.tar.gz $BACKUP_DIR/

# Cleanup
ssh $VPS "rm /tmp/backup_$DATE.tar.gz"

echo "Backup completed: $BACKUP_DIR/backup_$DATE.tar.gz"

❓ FAQ

What's the difference between RSA and Ed25519?

AspectRSA 4096Ed25519
SecurityExcellentExcellent
PerformanceSlowerFaster
Private key size~3.3 KB~400 bytes
Public key size~800 bytes~68 bytes
Generation~5 seconds<1 second
CompatibilityUniversalOpenSSH 6.5+ (2014)
Quantum resistanceNoNo
RecommendationOld systemsModern VeryCloud VPS

VeryCloud Recommendation: Ed25519 for all new VPS (Ubuntu 22.04+, Debian 12+)

Can I use the same key for multiple VeryCloud servers?

Yes, you can install the same public key on multiple VPS.

Advantages:

  • Single key to manage
  • Simplified connection
  • Fewer files to backup

Disadvantages:

  • If key is compromised, all your servers are vulnerable
  • No traceability per server

VeryCloud Recommendation:

Production     →  prod_key_ed25519
Development    →  dev_key_ed25519
Testing        →  test_key_ed25519
Personal       →  personal_key_ed25519

How to add a comment to my key?

The -C parameter allows adding an identifying comment:

ssh-keygen -t ed25519 -C "verycloud-prod-2026-dell-laptop"

The comment appears at the end of the public key:

ssh-ed25519 AAAAC3... verycloud-prod-2026-dell-laptop

Usefulness:

  • Quickly identify key origin
  • Track which machine uses which key
  • Organize keys in authorized_keys

Do SSH keys expire?

No, SSH keys don't have built-in expiration.

Rotation best practices:

┌─────────────────────────────────────┐
│ Recommended Frequency               │
├─────────────────────────────────────┤
│ Personal keys       : 1-2 years    │
│ Team keys          : 6-12 months   │
│ Service keys       : 3-6 months    │
│ After compromise   : Immediate     │
│ Employee departure : Immediate     │
└─────────────────────────────────────┘

How to copy my SSH key between computers?

Secure method (recommended):

  1. On source computer:
# Display private key
cat ~/.ssh/id_ed25519

# Display public key
cat ~/.ssh/id_ed25519.pub
  1. Transfer via secure channel:
    • Encrypted USB drive
    • Password manager (1Password, Bitwarden)
    • scp between your machines
    • NEVER via email, Slack, Discord
  2. On new computer:
mkdir -p ~/.ssh
chmod 700 ~/.ssh

# Create private key
nano ~/.ssh/id_ed25519
# Paste content
chmod 600 ~/.ssh/id_ed25519

# Create public key
nano ~/.ssh/id_ed25519.pub
# Paste content
chmod 644 ~/.ssh/id_ed25519.pub

Via SCP (if you already have SSH between machines):

# From source machine to new machine
scp ~/.ssh/id_ed25519* user@new-machine:~/.ssh/

What to do if I lost my private key?

Critical scenario: You can no longer connect

Solutions:

  1. Via VeryCloud VNC console (recommended):
    # Login via VNC console
    # Add new temporary key
    echo "ssh-ed25519 AAAAC3... new@key" >> ~/.ssh/authorized_keys
    
  2. Generate new pair:
    # On your PC
    ssh-keygen -t ed25519 -C "new-recovery-key"
    
    # Install via VNC or VeryCloud support
    
  3. Contact VeryCloud support:
    • 24/7 support available
    • Can help you recover access

Prevention:

  • ✅ Backup your keys in password manager
  • ✅ Keep encrypted offline copy
  • ✅ Maintain multiple authorized keys

How to temporarily disable a key without deleting it?

Comment the line in authorized_keys:

nano ~/.ssh/authorized_keys

Add # at the beginning of the line:

# ssh-ed25519 AAAAC3... temporarily-disabled-key
ssh-rsa AAAAB3... active-key

Reactivate by removing the #


🎯 Complete Configuration Checklist

Phase 1: Key Generation

  • SSH key generated (Ed25519 or RSA 4096)
  • Strong passphrase set (12+ characters)
  • Private key saved securely
  • Public key copied to clipboard
  • Comment added to key (identification)

Phase 2: VeryCloud VPS Installation

  • Initial VPS connection successful (password)
  • ~/.ssh directory created with 700 permissions
  • Public key added to authorized_keys
  • authorized_keys permissions set to 600
  • SSH key connection test successful
  • Password disabled in sshd_config
  • SSH service restarted
  • New connection tested (key only)

Phase 3: Security

  • PasswordAuthentication no configured
  • PubkeyAuthentication yes verified
  • PermitRootLogin configured as needed
  • Backup session maintained during tests
  • VeryCloud VNC console access verified (backup)
  • Private key never shared
  • Key backup performed

Phase 4: Advanced Configuration

  • ~/.ssh/config created and configured
  • ssh-agent configured for passphrase
  • Connection aliases tested
  • Automation script created (if needed)
  • Personal documentation updated

Phase 5: Documentation and Maintenance

  • VPS IP noted
  • SSH user documented
  • Private key location noted
  • Passphrase stored securely
  • Creation date noted (annual rotation)
  • Recovery procedure defined

📚 Additional Resources

VeryCloud Documentation

ResourceLink
Client areamanager.verycloud.fr
Documentationdocs.verycloud.fr
24/7 SupportTickets in client area
VNC ConsoleAccessible in client area
Service statusstatus.verycloud.fr

SSH Technical Documentation

TopicLink
OpenSSH Manualman ssh or man sshd_config
RFC 4251 (SSH Protocol)https://www.rfc-editor.org/rfc/rfc4251
Ed25519 Signature Schemehttps://ed25519.cr.yp.to/
ToolUsageLink
PuTTYSSH Client Windowshttps://www.putty.org/
KeePassXCPassword Managerhttps://keepassxc.org/
WinSCPFile Transfer Windowshttps://winscp.net/
TermiusCross-platform SSHhttps://termius.com/

VeryCloud Community

PlatformDescriptionAccess
Discord600+ members, community supportJoin
ForumAdvanced guides and tutorialsdocs.verycloud.fr

Need Help?

VeryCloud team is available 24/7 to assist you:

┌──────────────────────────────────────┐
│    VeryCloud 24/7 Support            │
├──────────────────────────────────────┤
│                                      │
│  📚 Documentation                    │
│     docs.verycloud.fr                │
│                                      │
│  🎫 Technical Support                │
│     manager.verycloud.fr             │
│     (Open a ticket)                  │
│                                      │
│  💬 Community Discord                │
│     600+ active members              │
│                                      │
│  📊 Service Status                   │
│     status.verycloud.fr              │
│                                      │
└──────────────────────────────────────┘

Support Hours:

  • 🕐 24/7/365 - Technical support via ticket
  • 💬 24/7 - Discord community
  • 📱 Response time - Less than 30 minutes average

Guide written by VeryCloud SAS • Last updated: January 30, 2026Version 2.0 - Tested on Ubuntu 24.04 LTS, Debian 12, with OpenSSH 9.6+

Join our Discord community server

For any questions, suggestions, or just to chat with the community, join us on Discord!

900+Members