Updated: 30 April 2025
Prefer password authentication over public key
ssh -o PreferredAuthentications=password -o PubkeyAuthentication=no user@example.com
Use one specific private key
ssh -o "IdentitiesOnly=yes" -i /home/me/path/to/private/key/id_rsa user@host
Use a non-standard port
ssh user@192.168.1.1 -p 26
Kill a ssh session
ps -A | grep ssh
kill PID # the process id from previous command
Generate a key pair
ssh-keygen -t rsa
Copy ssh key to clipboard
cat ~/.ssh/id_rsa.pub | xclip -sel clip