In ssh config you can easily edit a hostname by appending or prepending it with something. For example, when you want to connect to server with ssh test5
, but actually the server name is test5.mail, you can specify the server as like this:
Match exec "echo %h | grep -q '^test[0-9]$'"
HostName %h.mail
The same approach could be applied if you need to prepend hostname.
But what if I want to edit the middle of the hostname? For example, I want to connect as ssh server1.storage
, but the actual address I want to connect to is server1.int.storage.
In other words, I want to insert substring in the middle of %h.