Skip to contentcloudvix
cloudvix
GuideServers & hosting

How to create an SSH key and use it on your server

Denys DunaievskyiFounder, Cloudvix
  • 2 min read
  • Published
  • LevelBeginner
Guides
On this page

Key takeaways

  • Open a terminal and run ssh-keygen -t ed25519. It asks where to save the key and for an optional passphrase, then writes two files: id_ed25519 (private) and id_ed25519.pub (public).
  • The private file never leaves your computer and is never pasted anywhere.
  • Use a separate key for each computer you work from, so you can remove one without touching the others.

An SSH key replaces the password with a pair of files: a public half you hand out and a private half that stays on your computer. Setting it up takes a few minutes.

Create the key pair

Open a terminal and run ssh-keygen -t ed25519. It asks where to save the key and for an optional passphrase, then writes two files: id_ed25519 (private) and id_ed25519.pub (public). Linux, macOS and current Windows all include ssh-keygen.

Add the public half to your account

Open the .pub file and copy its one line. In the dashboard, add it under SSH keys, then choose it when you order a server. The private file never leaves your computer and is never pasted anywhere.

Log in

Run ssh root@ followed by the server’s IPv4 address from the dashboard. If your key is not in the default place, add -i and the path to the private file.

Keep the private key safe

Anyone who has the private file can log in as you, so a passphrase is worth the extra second. Use a separate key for each computer you work from, so you can remove one without touching the others.

About the author

Denys Dunaievskyi

Founder, Cloudvix

Runs Cloudvix and is responsible for the guides published here.

Related guides

Your server is a few clicks away.

Choose the plan and the system in one order form; the location too, when there is more than one.

Create server