Skip to content
BENIBIX Learn

Secure Shell (SSH)

Infrastructure🔑 SSH & Remote AccessSSH Basics

Also known as SSH, ssh Command, SSH Login, OpenSSH

A locked line to a far computer. You log in and type commands on it.

Think of it like

Think of it like a secret phone line to a far house. You talk, the house does it, and nobody can listen in.

Example

Emma rents a server in Frankfurt. From her laptop in London she types ssh emma@203.0.113.10 and gets a prompt on the server.

Why it matters

A headless server has no screen. SSH is the door you use to reach it.

Definition

SSH is a way to log in to another computer over a network and type commands on it. Everything you send is locked, so nobody in between can read it. You type ssh, then a user name and the server's address. The server usually listens on port 22. It is how almost every Linux server is run.

Example code

console
$ ssh emma@203.0.113.10
emma@web1:~$ hostname
web1
One line to log in. The next command runs on the server, not on the laptop.
The ssh command on the laptop talks to sshd on the server, through a locked line on port 22.

Common mistake

Typing a command and forgetting which machine you are on. Read the prompt before you run anything risky.

Key takeaways

  1. 1
    Locked line. Nobody in between can read it.
  2. 2
    Port 22. Where the server usually listens.
  3. 3
    Keys beat passwords. Log in with a key pair.

Learn it properly