SSH protocol fully explained.
Today I took a deep dive into SSH (Secure Shell) — one of the most fundamental tools in backend development and DevOps.
At its core, SSH is a cryptographic network protocol that allows secure communication between two systems over a network. It’s most commonly used for:
- Logging into remote machines
- Executing commands on servers
- Secure file transfer
Why SSH is Important
When working with remote servers (like cloud VMs or deploying applications), security is critical.
SSH ensures:
1. Encryption
All data exchanged between client and server is encrypted, so even if someone intercepts it, they can’t read it.
Get Aditya Raj’s stories in your inbox
Join Medium for free to get updates from this writer.
2. Authentication
SSH verifies identity using:
- Password-based login (less secure)
- Public key authentication (recommended)
3. Integrity
It ensures that data is not modified during transmission.
SSH Key-Based Authentication
SSH uses asymmetric encryption, which involves two keys:
- Private Key → stays on your machine (never share)
- Public Key → shared with servers like GitHub or Amazon Web Services
How Authentication Works ?
Simple Flow —
- Client sends a connection request
- Server sends a random challenge
- Client signs the challenge using its private key
- Server verifies it using the stored public key
- If valid → access granted (no password needed)
This is exactly what makes SSH both secure and seamless.
SSH Key Algorithms
Common algorithms used for generating SSH keys:
- RSA (older, widely supported)
- ED25519 (modern, fast, recommended)
- ECDSA
Working with SSH Keys
To generate a key:
ssh-keygen -t ed25519For multiple keys (best practice):
ssh-keygen -t ed25519 -f ~/.ssh/github_key
ssh-keygen -t ed25519 -f ~/.ssh/aws_keyWhy Multiple SSH Keys?
Instead of using one key everywhere, it’s better to create separate keys for:
- GitHub
- Cloud servers (AWS, VPS)
- Personal projects
This provides:
- Better security
- Easy access control
- Safer key rotation
** Important Concept I Learned **
While creating keys, the file path matters:
~/.ssh/key_name→ correct locationkey_name→ saved in current directory~/.ssh/id_ed25519/new_key→ invalid (becauseid_ed25519is a file, not a folder)
Final Understanding
SSH is not just a tool — it’s a secure identity system for machines.
- It replaces passwords
- It powers deployments
- It’s heavily used in DevOps workflows
> SSH keys are your digital identity for secure communication, and using multiple keys is the foundation of a professional DevOps setup.
Still exploring deeper into SSH and DevOps.
Next step: connecting this knowledge to real deployments







