home blog portfolio Ian Fisher

SSH cheatsheet

Restart the SSH agent (macOS)

$ eval "$(ssh-agent -s)"

Create a new key (macOS)

$ ssh-keygen -t ed25519 -C "ian@iafisher.com"
$ ssh-add --apple-use-keychain path/to/key
$ eval "$(ssh-agent -s)"

Add key to remote server

$ ssh-copy-id -i path/to/key USER@SERVER

Deny password authentication

In /etc/ssh/sshd_config:

PermitRootLogin no # or without-password
PasswordAuthentication no

Read logs

$ less /var/log/auth.log

See also