SSH login

SSH (Secure SHell) allows local access to a remote machine.


SSH keys are essential when securing a public-facing server.

generate with ssh-keygen

$ ssh-keygen
Enter file: ~/.ssh/<key name>
Enter passprhase: (skip)

copy to remote server with ssh-copy-id

$ ssh-copy-id -i ~/.ssh/<key name> root@host

Password-less login

edit /etc/ssh/sshd_config

PasswordAuthentication no
ChallengeResponseAuthentication no
UsePAM no

Reload SSH daemon with systemctl reload sshd


Stored at ~/.ssh/config

Notable fields:

Example configuration:

Host storageserver
 Port 2222
 User notahacker
 IdentityFile ~/.ssh/storageserver