• UNIX / LINUX Basics
    • ➟ Prerequisites

Bash Guide for Beginners

The definitive guide, also available at SafariOnline

  • Public/private keys, pass phrases

  • Trusted hosts

  • Port forwarding

  • X11 forwarding

  • ssh agent

Vim Introduction and Tutorial

ssh-keygen 
Generating public/private rsa key pair.
Enter file in which to save the key (/home/goik/.ssh/id_rsa): 
Created directory '/home/goik/.ssh'.
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/goik/.ssh/id_rsa.
Your public key has been saved in /home/goik/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:mi/5CaYsND/Dc+qr8CJ9Yji/zzP1SwuES/OmlnqvvK0 goik@bw-lehrpool
The key's randomart image is:
+---[RSA 2048]----+
|                 |
|                 |
|                 |
|     .           |
|    + . S        |
|  o. =.o         |
|.+ +.oOo.        |
|=o=+&*+=.o       |
|.=*%E#oo*.       |
+----[SHA256]-----+
cd .ssh 

touch known_hosts 
cp id_rsa.pub authorized_keys 

setfacl -R --remove-all . * 

chmod go-w . * 
chmod ugo-x * 
chmod go-r id_rsa 
ls -al

drwxr-xr-x+  2 goik fb1prof    0 Oct 13 16:03 .
drwxr-xr-x+ 30 goik fb1prof    0 Oct 13 16:04 ..
-rw-r--r--+  1 goik fb1prof  398 Oct 13 16:02 authorized_keys
-rw-------+  1 goik fb1prof 1675 Oct 13 16:02 id_rsa
-rw-r--r--+  1 goik fb1prof  398 Oct 13 16:02 id_rsa.pub
-rw-r--r--+  1 goik fb1prof  222 Oct 13 16:03 known_hosts

Testing ssh private key based logins to your local system:

~> ssh localhost
Welcome to Ubuntu 18.04.3 LTS ...