What is SSH?
SSH = Secure Shell
It is a network protocol that allows you to securely connect to and manage remote servers over an encrypted channel.
-
Works on port 22 (by default).
-
Provides authentication (usually via username + password or SSH keys).
-
Encrypts all traffic (unlike old protocols like Telnet or FTP which send data in plain text).
What You Can Do With SSH
-
Remote login → Securely access and control Linux/Unix servers.
-
File transfers → Using
scporsftp(built on SSH). -
Tunneling/Port forwarding → Securely forward traffic (e.g., database connections).
-
Automation → Used in scripts, CI/CD pipelines for remote execution.
How SSH Works
-
Client → Server: You run
ssh user@server-ip. -
Handshake: The server and client exchange keys to set up encryption.
-
Authentication:
-
Password-based OR
-
Key-based (preferred) → You use an SSH key pair:
-
Private key (kept safe on your local machine).
-
Public key (stored on the server in
~/.ssh/authorized_keys).
-
-
-
Secure Session: You now have a secure shell to run commands remotely.
SSH in AWS
-
When you launch an EC2 instance, you usually connect via SSH.
-
AWS gives you a key pair (.pem file) when creating the instance.
-
Example command:
-
Without SSH, you wouldn’t be able to log in securely to manage EC2 Linux instances.
No comments:
Post a Comment