Hostxpeed
Login Get Started →
Security

How to Enable SSH Key Authentication

5 min read
31 views
Jun 11, 2026

Step 1: Generate SSH Key Pair (Local Machine)

ssh-keygen -t ed25519 -C "your_email@example.com"

Step 2: Copy Public Key to Server

ssh-copy-id username@YOUR_SERVER_IP -p PORT

Step 3: Manual Copy (if ssh-copy-id fails)

cat ~/.ssh/id_ed25519.pub | ssh username@YOUR_SERVER_IP "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"

Step 4: Set Correct Permissions

chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys

Step 5: Test Login

ssh username@YOUR_SERVER_IP -p PORT

Was this article helpful?