Jul 5, 2025 1 min read

How to Access Your Server Without a Password (SSH Key Authentication)

How to Access Your Server Without a Password (SSH Key Authentication)

1. Generate SSH Key Pair on Your Local Machine

ssh-keygen -t rsa -b 4096 -f ~/.ssh/server_access_key -C "your_email@example.com"

Creates:

2. Add Public Key to Server via Web Console

  1. Open the web console (DigitalOcean/AWS/etc.).
  2. Run:
mkdir -p ~/.ssh
echo "PASTE_PUBLIC_KEY_HERE" >> ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
chmod 700 ~/.ssh

3. Test SSH Login from Local Machine

ssh -i ~/.ssh/server_access_key root@your_server_ip

4. (Optional) Disable Password Login for Security

On the server:

sudo nano /etc/ssh/sshd_config
Uncomment/add:
PasswordAuthentication no
PermitRootLogin prohibit-password
  1. Restart SSH:
sudo systemctl restart ssh    # Ubuntu/Debian
# OR
sudo systemctl restart sshd  # RHEL/CentOS

Key Takeaways

Final Tip

Back up your private key (~/.ssh/server_access_key) somewhere safe! 🔐

Liked this? Get more in your inbox.

One short email when I publish. AWS, AI, and founder notes — no spam, unsubscribe in one click.

By JOY 11 months ago

// Read next

How to Host Your Static Website on AWS S3 and CloudFront (Step-by-Step Guide)

# 🌍 Day 1 — Host a Static Website on AWS (S3 + CloudFront) When I started my …

AWS EventBridge Explained: The Ultimate Q&A Guide for Developers (with Real-Life Examples)

# 🧩 AWS EventBridge Explained: The Ultimate Q&A Guide for Developers (with Real-Life Examples) ## 🧠 1. What …

AWS API Gateway: A Practical, Step-by-Step Guide

## 🔗 What Is API Gateway? AWS API Gateway is the **entry point** for your backend APIs. It …