Prerequisites
The definitive guide, also available at SafariOnline
-
Public/private keys, pass phrases
-
Trusted hosts
-
Port forwarding
-
X11 forwarding
-
ssh agent
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 ❼
Enter secure shell client configuration directory. |
|
Creating an empty file |
|
The |
|
This invocation pays tribute when using a Windows network share: The extended ACLs are too open with respect to security considerations. |
|
Only the owner is allowed to read |
|
Configuration files do not necessitate execution privileges. |
|
The ssh private key should only be accessible by its respective owner. |
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 ...
No. 1
Enabling index based file search
Q: |
|
A: |
The first locate
|
No. 2
Using the tail -f
command
Q: |
|