ssh

last updated: 17 Apr 2022

protocol examples:

secure network connections

SSH: Secure Shell Protocol

CLI command for ssh connections

SSH under-the-hood:

notes

setup SSH

on a mac/linux


# go to the system SSH config folder 
cd ~/.ssh

# check if `id_rsa` (the private key) and `id_rsa.pub` (the public key) exist
ls -a

# create a public-private key pair if they doesn't exist
ssh-keygen -C "<some-comment>"

# provide new file path to avoid stock name `id_rsa` that might be over-written 
# then check to see if the SSH key pair has been generated
ls -a

# register the newly created SSH private key with the system SSH agent
ssh-add ~/.ssh/id_rsa.pub

# copy public key to clipboard
pbcopy < ~/.ssh/id_rsa.pub

# login to the SSH server using the password authentication 
`ssh {user}@{host}` 

# navigate to the SSH config folder and ensure it has an extensionless file named `authorized_keys`
cd ~/.ssh && ls -a

# if `authorized_keys` file doesn't exist, make a blank one
touch authorized_keys

# open `authorized_keys` with the light-weight CLI text editor
nano authorized_keys

# paste the public key inside this file from clipboard, save file, and exit

# logout of the current password authenticated session on the SSH server

# log back in again to find that no password is needed after a correct SSH setup

windows

notes

SSH multi computer tunneling

references


created: 16 Apr 2022