Skip to content
Log In Sign Up info@muvcloud.com

Generate a Key

Run this in a terminal on your own computer, not on the server:

ssh-keygen -t ed25519 -C "laptop-2026"

-t ed25519 chooses the key type and -C adds a comment that helps you recognize the key later. ssh-keygen then asks two questions:

  1. File location: press Enter to accept the default, ~/.ssh/id_ed25519. Choose another name with -f if you keep separate keys, for example -f ~/.ssh/work_ed25519.
  2. Passphrase: type a passphrase twice. It encrypts the private key on disk, so a copied file is useless without it.

ssh-keygen prints the key fingerprint and a small picture made of characters. Neither needs to be saved.

The Two Files

FileWhat it isShare it?
~/.ssh/id_ed25519Private keyNever
~/.ssh/id_ed25519.pubPublic keyYes

The private key never leaves your computer: do not e-mail it, paste it into a chat, or copy it to a server. If you work from two computers, create a key on each one. The public key is safe to give out; a server that has it can check your identity but cannot log in anywhere with it.

What a Public Key Looks Like

cat ~/.ssh/id_ed25519.pub

The output is one line with three parts separated by spaces: the key type (ssh-ed25519), a long block of letters and digits, and your comment. When you paste it somewhere, copy the whole line without line breaks.

Ed25519 or RSA?

Use Ed25519. The keys are short, fast, and supported by every current OpenSSH release and by services such as GitHub. Create an RSA key only for an old system that does not accept Ed25519, and give it at least 3072 bits:

ssh-keygen -t rsa -b 4096 -C "laptop-2026-rsa"

Do not create DSA keys: OpenSSH has disabled them by default for years, and OpenSSH 10.0 removed DSA support completely.

Permissions

ssh refuses a private key that other users can read. ssh-keygen sets the right modes, but files copied from a backup may need fixing:

chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_ed25519
chmod 644 ~/.ssh/id_ed25519.pub

More on modes in chmod recursive.

The Passphrase and ssh-agent

An agent holds the unlocked key in memory, so you type the passphrase once per login session instead of on every connection. Many desktop systems start one for you; otherwise start it and add the key:

eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
ssh-add -l

ssh-add -l lists the keys the agent holds.

Where the Public Key Goes

On a server, public keys are listed one per line in ~/.ssh/authorized_keys of the account you log in to. When you connect, the server checks your key against that list, and your computer proves with the private key that it holds the matching half. The private key itself is never sent.

Change the Passphrase or the Comment

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

-p changes the passphrase and -c changes the comment. The key itself stays the same, so servers that already know it keep working.

Next Step: Put the Key on a Server

Copy the public key to the server with ssh-copy-id, then log in as described in how to SSH into a server. For a deploy key that lets a server pull code, see GitHub SSH key.

Updated:

Linux VPS with Full Root Access

MUVCloud cloud servers run on KVM with Enterprise NVMe SSD storage and full root access, in Turkey, the Netherlands, and the USA.

Cloud VPS Plans Starting at2.99 $/mo Cheap Linux VPS

No Limits on Service or Support

You are not on your own as your projects grow. Our support engineers are ready 24/7, on several channels, whenever you need them.

Support specialist
  • 100% customer satisfaction goal
  • Our own hardware
  • 24/7 ticket and email support
  • 4 countries with locations