SSH keys provide a more secure way to log into your server than passwords alone. This article explains how to generate an SSH key pair and add the public key to your server.
Generating an SSH Key Pair
On macOS or Linux, open a terminal and run:
ssh-keygen -t ed25519 -C "your-email@example.com"
Follow the prompts to save the key. You can press Enter to accept the default location.
On Windows, you can use PuTTYgen or Windows Terminal with OpenSSH.
Copying the Public Key to Your Server
Use the ssh-copy-id command:
ssh-copy-id -i ~/.ssh/id_ed25519.pub username@your-server-ip
Or manually add the contents of your .pub file to ~/.ssh/authorized_keys on the server.
Disabling Password Authentication
For maximum security, edit /etc/ssh/sshd_config and set:
PasswordAuthentication no
PubkeyAuthentication yes
Then restart the SSH service:
systemctl restart sshd
Need Help?
If you need assistance setting up SSH keys, contact us through the Circle City Servers Support Portal.