Host x
Hostname full.host.name.com (or 1.2.3.4)
User <myuser>
IdentitiesOnly yes
IdentityFile ~/.ssh/id_x_ed25519
I give hosts short names so you can `ssh x`to do automatic login, I generate identities for some machines
ssh-keygen -t ed25519 -f ~/.ssh/id_x_ed25519
use ssh-copy-id to copy the identity to the target machine so it lets you in: ssh-copy-id -i ~/.ssh/id_x_ed25519.pub x
or if your machine doesn't have ssh-copy-id (older macs); cat ~/.ssh/id_x_ed25519.pub | ssh x "cat >> .ssh/authorized_keys"
IdentitiesOnly means it will only send that one identity for that one machine (otherwise it will try all of them, like a janitor trying to open a locker with a big keychain of identical keys)If you always want to use a password to log into a machine, but want to be able to log in in other windows to the same machine without a password:
Host x
...
ControlMaster auto
ControlPath ~/.ssh/master-%r@%h:%p
this will multiplex all activity to that host through one tcp connectionyou can also use Host * at the beginning of your config to do this for all hosts
to tunnel vnc over ssh to a remote mac(I do this with mac)
Host foo
...
LocalFoward 5900 localhost:5900
ssh foo
then locally vnc to localhost:127.0.0.1