I have an SSH config like the one below, which works great for:
ssh b21
ssh 23
ssh s267
Example .ssh/config (hostname passed is slotted in at %h):
host s*
HostName atrcu%h.example.com
User example
Port 22
host b*
HostName atrcx%h.example.com
User example
Port 22
host ??*
HostName atvts%h.example.com
User example
Port 2205
but I'd like to include the username in the host:
ssh b21ex
which would ssh to:
[email protected]
but instead will:
atvts21ex.example.com
is their any way to cut/modify %h as it's passed and perhaps have the connection match more patterns to get a username along the way?