---
title: "SSH key"
description: "An SSH key is a cryptographic key pair for passwordless, secure server login. Learn about the private and public key and how to use them safely."
url: "https://nodea.io/en/glossary/ssh-key"
lang: "en"
updated: "2026-07-13"
---

# SSH key

> An SSH key is a pair of cryptographic keys (private and public) used for secure, passwordless authentication of connections to a server over the SSH protocol.

An **SSH key** is an authentication method for the [SSH](https://nodea.io/en/glossary/ssh) protocol based on asymmetric cryptography. Instead of typing a [password](https://nodea.io/en/glossary/password), the user logs into a server using a pair of mathematically related keys: a private one and a public one. This is a far more secure and convenient way to access remote machines than a traditional password, which is why it's the standard in server administration.

## What an SSH key pair involves

The mechanism rests on two inseparable elements:

- **private key** — the secret part that stays solely on the user's computer and is never handed to the server; it can be additionally protected with a passphrase;
- **public key** — the non-secret part placed on the server in the *authorized\_keys* file; it can be shared without concern.

During login the server sends a random challenge, which the client signs with the private key. The server verifies that signature using the stored public key — a match confirms identity without any secret crossing the network. Keys are generated with the *ssh-keygen* command, choosing an algorithm such as Ed25519 or RSA.

## Practical application

SSH keys are the basis of administrators' and developers' daily work: logging into a [VPS](https://nodea.io/en/glossary/vps) and dedicated servers, deploying via [Git](https://nodea.io/en/glossary/git), automating with [Ansible](https://nodea.io/en/glossary/ansible) or CI/CD pipelines, where scripts must connect to servers without human interaction.

Their biggest advantage is resistance to [brute-force](https://nodea.io/en/glossary/brute-force-attack) attacks — cracking a key of adequate length is computationally infeasible, unlike guessing passwords. A good hosting practice is to disable password login and allow key authentication only, drastically reducing the risk of account takeover. The private key should be guarded like your most valuable secret and backed up regularly.

### Is an SSH key safer than a password?

Yes, significantly. A key of adequate length is practically impossible to crack by brute force, unlike passwords, which are often weak or reused. Moreover, the private key never leaves your computer and can be protected with a passphrase.

### What if I lose access to my private key?

Without the private key you can't log into a server configured for key authentication. That's why it's worth keeping a secure backup and an alternative access method — such as a rescue console from your VPS provider, through which you can upload a new public key.

## Related

- [SSH](https://nodea.io/en/glossary/ssh)
- [Server](https://nodea.io/en/glossary/server)
- [VPS](https://nodea.io/en/glossary/vps)
- [Password](https://nodea.io/en/glossary/password)
- [Brute force](https://nodea.io/en/glossary/brute-force-attack)

---

Languages: [pl](https://nodea.pl/pl/slownik-pojec/klucz-ssh.md)  
Site index: [llms.txt](https://nodea.io/en/llms.txt)
