Skip to content

What is SSH, and what is an SSH key?

SSH is how you log in to a computer somewhere else, like a rented server, from your own terminal. What an SSH key is, and the one command you type.

By Nick

1 min read

AI Basics Beginner
On this page

SSH is how you log in to a computer that isn’t in front of you, usually a rented server. You type one line in your terminal, and that window starts controlling the other machine. Anything you type next runs over there, not on your laptop.

The connection is scrambled (encrypted), so nobody in between can read it.

Log in

Your hosting company gives you an address (a string of numbers like 203.0.113.7) and a username. Then you type:

ssh root@203.0.113.7

The first time, it asks whether you trust this computer. Type yes. When the start of the line changes to the server’s name, you’re in. Type exit to leave.

What an SSH key is

A key is a pair of small files that log you in instead of a password.

  • The private key stays on your laptop. Never send it to anyone.
  • The public key (the same name ending in .pub) goes on the server. It’s safe to share.

When you connect, the two files prove to each other who you are. Nothing guessable crosses the internet, which is why it beats a password. Servers on the open internet get password guesses from bots all day.

To make a key, run this and press Enter at each question (or set a passphrase, a password that protects the key file itself):

ssh-keygen -t ed25519

Most hosting companies let you paste the .pub file’s contents into their website when you create a server. After that, ssh logs you in without asking for a password, and you can turn password login off.

Common questions

Is SSH safe?

Yes, the connection is encrypted. The weak point is the login: a guessable password. That's why guides tell you to use a key and turn password login off.

What if I lose my key?

You can't log in with it any more. Most hosting companies have a console in their website that lets you get back in and add a new key.

Can I share my key file?

Never share the private one (the file without .pub on the end). The .pub file is the one you hand over to servers; it's meant to be shared.

Related reading

Last reviewed 14 October 2026 by Nick.

Software changes fast. If something here is out of date, tell me and I'll fix it.

Get new guides by email

Occasional and practical. No spam, no hype, unsubscribe whenever.

Occasional practical guides from UncomplicateAI. You will get a confirmation email before anything else is sent. Unsubscribe any time. Privacy

You are not subscribed until you confirm the email. Unsubscribe any time.