Skip to content
Security2 min read

What is an SSH key?

Short answer

An SSH key is a pair of mathematically linked files: a private key that stays on your computer and is never shared, and a public key you place on a server or in GitHub. When you connect, your computer proves it holds the private key without sending it, so you log in without a password and with stronger protection.

ArabyHost teamLast updated: ShareWhatsAppXLinkedIn
Contents
  1. How it works
  2. Example: creating and using a key
  3. Common problems
  4. On ArabyHost

A password can be guessed or stolen through a phishing page; a private key never leaves your computer. That’s why many server admins turn off password logins entirely and accept only keys, which makes brute-force attacks fail automatically.

How it works

  1. You create the key pair on your computer.
  2. You add the public key to ~/.ssh/authorized_keys on the server.
  3. When you connect, the server sends a challenge only the holder of the private key can answer.
  4. Your computer answers it, and the server confirms who you are without the private key ever crossing the network.

Example: creating and using a key

ssh-keygen -t ed25519 -C "[email protected]"
cat ~/.ssh/id_ed25519.pub

The first command creates two files:

File Contains Share it with
~/.ssh/id_ed25519 The private key Nobody, ever
~/.ssh/id_ed25519.pub The public key Servers, GitHub, any service you log in to

The second prints the public key so you can copy it. Once it’s on the server, connect like this:

ssh -i ~/.ssh/id_ed25519 [email protected]

If you protected the key with a passphrase, run ssh-add ~/.ssh/id_ed25519 once and ssh-agent holds it for the session, so you don’t retype it on every connection.

Common problems

  • Permission denied (publickey): the public key isn’t installed, you’re offering a different key, or permissions are wrong. See that error’s page.
  • Permissions too open: SSH refuses keys when ~/.ssh or authorized_keys is writable by others, or when the private key is readable by others. The safe values are 700 for the folder and 600 for the key files; work them out with the chmod calculator.
  • Pasting the private key instead of the public one: the public key is the file ending in .pub, starting with ssh-ed25519.

On ArabyHost

SSH is available on AI/Developer plans, jailed in CageFS. Add your key in cPanel under Security → SSH Access → Manage SSH Keys: import the public key, then click Authorize. After that you can log in with the key and run Git, Claude Code and Codex. Full steps are in the set up SSH keys guide, and plan details are on the developers page.

FAQ

Can I use the same key on several servers?

Yes, you can put the same public key on any number of servers. But if the private key is stolen they're all exposed, so some people prefer one key per computer they work from.

What is the passphrase for?

It encrypts the private key on your computer, so a stolen key file is useless without it. With ssh-agent you only type it once per session.

Which type should I choose, Ed25519 or RSA?

Ed25519 is the modern default: shorter, faster and secure. Use 4096-bit RSA only for an old system that doesn't support Ed25519.

Useful? Share it with someone who needs it:WhatsAppXLinkedIn

Read next

Ready to put your idea online?

Fast, isolated hosting, support that understands you, and an AI assistant that fixes problems with you.