ssh tips and tricks

Besides two great talks by leyrer at the GPN about SSH, b0rk (Julia Evans) collected nice tips in a mastodon thread. I list some of them for later reference here.

Secretive is an app to store your SSH key in Apple mac's secure enclave. So instead of just storing the passphrase in your Keychain, you store your key in the trusted computing chip. I want to test it. Unfortunately, it also doensn't support sk-keys so one cannot detect this key from the server. So far I did something along the lines of

# This is only used on Mac
but this makes it work on all systems
# on Linux I get gnomes
agent automatically
IgnoreUnknown UseKeychain
UseKeychain yes
AddKeysToAgent yes

As mentioned in my other post about SSH forwarding you could use the following config snippet instead of -L

LocalForward <localport> IP-addr:<remoteport>

Some time ago I stumbled uppon an blog post hacking with the following feature a vimrc syncing mechanism. The basics are this

Host *
SendEnv TERM_PROGRAM TERM

Another neat feature from the thread is the replacement

ProxyJump, often coupled with Hostname %h.fulldomain

and similarly

host foo-???? bar-???? baz-???? Hostname %h.example.com I can then ssh foo-1234, ssh baz-93hj, etc. and not have to type the entire host name. (TODO: I have to translate this)

Also, I have to gain some experience with Canonicalize as mentioned by deraffe

links

social