SSH Basics

SSH (short for Secure Shell) is a network protocol used to encrypt communication between two computers and supports various authentication mechanisms.

In practice, it is mainly used to secure remote logins and remote communications, and any network service can be encrypted using this protocol.

What is SSH

Historically, communication between network hosts has been unencrypted and in plaintext. This made communication very insecure and a typical example of this is server logins. When logging on to a remote server, the password entered by the user needs to be passed to the server. If this process is plaintext communication, it means that any intermediate computers that the line passes through during the pass can see the password, which is scary.

SSH was created to solve this problem by encrypting communications between computers to ensure that they are not eavesdropped or tampered with. It can also authenticate and authorise the operator. Plaintext network protocols can be applied to it to achieve encryption.

History

In 1995, Tatu Ylönen, a researcher at the Helsinki University of Technology in Finland, designed the first version of the SSH protocol (now called SSH 1) and wrote the first implementation (called SSH1).

At the time, his university network had been experiencing password sniffing attacks and he had to devise a more secure way of logging in to the server. Once written, he made the tool public and allowed others to use it for free.

SSH was a popular replacement for the insecure protocols of rlogin, TELNET, FTP and rsh and grew rapidly to 20,000 users in 50 countries by the end of 1995.

In December 1995, due to the growing demand for customer service, Tatu Ylönen set up a company, SCS, to sell and develop SSH, the successor to the software, which gradually went from free software to proprietary commercial software.

The SSH 1 protocol had some security flaws, so in 1996 the SSH 2 protocol (or SSH 2.0) was introduced. This protocol, which was incompatible with version 1.0, was standardized in 1997 and a software implementation of SSH2 was released in 1998; however, the official SSH2 software was a proprietary piece of software that was not free to use and some of the features of SSH1 were not available.

In 1999, the developers of OpenBSD decided to write an open source implementation of the SSH 2 protocol, which became the OpenSSH project. The project was initially based on SSH version 1.2.12, which was the last open source version of SSH1 at the time. However, OpenSSH soon broke away completely from the original official code and developed along its own lines with the involvement of many developers. openSSH was shipped with OpenBSD version 2.6 and later ported to other operating systems, becoming the most popular SSH implementation. Today, almost all distributions of Linux come with OpenSSH.

There are now several implementations of SSH-2, both free and paid. The content of this book is focused on OpenSSH.

SSH Architecture

The software architecture of SSH is a Server - Client model. In this architecture, the SSH software is divided into two parts: the part that makes requests to the server, called the client, which OpenSSH implements as ssh, and the part that receives requests from the client, called the server, which OpenSSH implements as sshd.

This tutorial agrees that upper case SSH denotes the protocol and lower case ssh denotes the client software.

In addition, OpenSSH also provides some helper software (e.g. ssh-keygen, ssh-agent) and specialised client tools (e.g. scp and sftp), which will also be covered in this tutorial.