SSH TALK - March 8, 2022


About me:


What is SSH?

SSH (secure shell) is a client/server remote access tool used primarily on Unix systems (AIX, Solaris, Linux, Unix, etc...). Originally developed in 1995 as an alternative to unencrypted rsh, telnet, and rlogin, it has become the standard method of connecting to networked systems of the *nix persuasion.
OpenSSH is the major player, but there are other variants of the protocol, like DropBear which is sometimes found on embedded devices.

How does SSH work?

Client/Server over encrypted channels.
A user uses an SSH client to connect to a networked system when has a listening SSH service/daemon/socket (IPADDR + PORT = SOCKET).

When the daemon catches an SSH request, a secure pipe is created between the client and server overwhich credentials can be securily typed or passed via keys to authenticate the user. Assuming all goes well the now authenticated user will be served a terminal.

Demonstration 1

Create key pairs for 'crashdummy' user

# Create key pair
$ ssh-keygen -t ecdsa

# Default path
$ ls -al ~/.ssh/

# SSH to remote system
$ ssh

# Show 'known_hosts'
$ ls -al ~/.ssh/

# Push SSH public key
$ ssh-copy-id

# Check server side..
$ ls ~/.ssh/

Demonstration 2

Secure an otherwise insecure login

Step 1

First, build the secure tunnel through your SSH server

ssh -L 2323:insecure:23 sshserver

flowchart LR A[localhost] --> |ssh 22| B[sshserver] --> |telnet 23| C[insecure]

Step 2

Next, connect to the insecure host over your local secure tunnel

telnet localhost 2323

flowchart LR A[localhost] --> |telnet 2323| A[Localhost] A[localhost] -.-> |ssh 22| B[sshserver] -.-> |telnet 23| C[insecure] -.-> |local 2323| A[localhost]

Sources and References: