Welcome, Developer!

This guide is designed to fully equip you with the knowledge of SSH (Secure Shell). As a developer, mastering SSH is a fundamental skill for managing servers, deploying applications, and interacting with version control systems like Git securely and efficiently. We'll start with the basics and progressively build up to advanced, practical applications.

Core Concepts: The Handshake

At its heart, SSH works on a client-server model. When you try to connect, your machine (the client) and the remote server perform a "handshake" to establish a secure, encrypted channel. This diagram illustrates the simplified process of setting up that secure connection. Hover over each step to learn more.

Client
(You)
1. Algorithm Negotiation

Secure Tunnel

Established
2. Key Exchange
Server
(Remote)
3. User Authentication

Authentication: Who Are You?

After the secure channel is created, you need to prove your identity. There are two main ways to do this. Public-key authentication is the industry standard for security and automation. Click on each method to see how it works.

Password Authentication

The straightforward method: you provide a username and password. Simple, but less secure and not ideal for scripts or automation.

Public-Key Authentication (Recommended)

The superior method. You have a key pair: a private key you keep secret, and a public key you place on the server.

Advanced Features

SSH is more than just a remote shell. It offers powerful features for developers to securely access resources and automate workflows. Below are some of the most useful advanced capabilities.

SSH Tunneling (Port Forwarding)

Securely access network services on a remote machine as if they were running on your local machine. Very useful for accessing databases or web UIs that aren't exposed to the public internet.

Local Forwarding (-L)

Maps a port on your local machine to a port on the remote server.

ssh -L 8080:localhost:80 user@remoteserver

Accessing `localhost:8080` in your browser connects you to port 80 on `remoteserver`.

Remote Forwarding (-R)

Exposes a service on your local machine to the remote server.

ssh -R 9000:localhost:3000 user@remoteserver

Anyone connecting to port 9000 on `remoteserver` is forwarded to port 3000 on your local machine.

Command Cheatsheet

Here are the essential SSH-related commands you'll use daily. Click any command to see its common usage and syntax.

Practice Zone: Simulated Terminal

Time to get hands-on. This is a simulated terminal where you can practice SSH commands safely. There's no real server connection. Follow the instructions and type the commands to complete the exercises.

bash -- SSH Practice
user@local:~$