ssh: Tokens and parameter expansion
ssh
provides a number of tokens that will be dynamically replaced in various connection options e.g.:
%n
- the remote hostname (as provided on the command line)%h
- the remote hostname
See more in the man pages: man ssh_config | less '+/^TOKENS'
It also supports referencing local environment variables via ${...}
syntax, and since that supports bash
expansion there are possibilities for sneaky hacks like:
https://blog.jbowen.dev/tips/ssh-tmux/
Published on: 28 Jul 2025