Quantcast
Channel: User Karthik T - Stack Overflow
Viewing all articles
Browse latest Browse all 42

Answer by Karthik T for SSH config file setup with wildcards and DRY

$
0
0

On top of figuring out why the config was "breaking", I discovered a new directive Match. This lets me do what I intend

Host shortname1?    Hostname %h.prod.xyz.comHost test-myname    Hostname combo.test-myname.xyz.comHost *.xyz.com    Hostname %hMatch Host *.xyz.com    User myuser    Port 12345    IdentityFile ~/.ssh/id_rsa

This config does exactly what I need. I needed to use Host instead of Hostname in the match because it didnt seem to accept Hostname but Host seems to be exactly what I need.

I was having arbitrary behaviour because I missunderstood that Hostname could not be used as I was using before, as a filter or match like statement. It can only be used inside a Host, or Match and as such, was implicitly below the last Host statement.


Viewing all articles
Browse latest Browse all 42

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>