← Back

SSH config

Setting ssh connectivity on a new machine. Just so that I remember.

On SSH client:

ssh-keygen
scp ~\.ssh\id_ed25519.pub user@host:/tmp/user.pub
ssh user@host
mkdir -p ~/.ssh
cat /tmp/user.pub >> ~/.ssh/authorized_keys
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
exit
ssh user@host

Key passphrase prompt should appear instead of the password prompt. Unless the key is not encrypted, then it should just log in.

sudo nano /etc/sshd_config

Ensure:

PasswordAuthentication no
PermitRootLogin no
PubkeyAuthentication yes
sudo systemctl restart ssh

Done.