Skip to content
This repository has been archived by the owner on Dec 21, 2022. It is now read-only.

No support for "Match" directive #94

Open
plambert opened this issue Jan 20, 2015 · 2 comments
Open

No support for "Match" directive #94

plambert opened this issue Jan 20, 2015 · 2 comments

Comments

@plambert
Copy link

An .ssh/config file like this: https://gist.github.com/plambert/9f39b3de68da9133d498

Match originalhost=github.com
  CanonicalizeHostname no

Match host=two_sshd_host user=alt_user
  Port 2222

Results in output like this:

$ storm list
 Listing entries:

   (*) General options: 
      canonicalizehostname: no
      match originalhost: github.com
      match host: two_sshd_host user=alt_user
      port: 2222

This is not correct.

I am a lousy python programmer or I'd try to add the support myself and submit a pull request.

@emre
Copy link
Owner

emre commented Jan 20, 2015

I was not aware of the match directive. thanks!

adding support for it may be tricky. keep it on me, I will add it in a couple of weeks.

@plambert
Copy link
Author

Thanks, Enre. I think it might make sense to treat the Match and Host directives very similarly--rather than having a 'host' dictionary and adding everything to it, have a 'stanza' dictionary that includes a flag for whether it is a Match or Host stanza.

Then parse the Match parameters and put them into an array value in a key in the stanza, so they can be printed with nice formatting. Then when appending it to the list of entries in the config file, set the 'type' appropriately.

Easier said than done, of course!

Other directives you may or may not be handling are SendEnv (whose values are additions to a list, like the Local/Remote Forward directives), IgnoreUnknown (ideally, this should make the listed directives show in the 'list' output as requiring OpenSSH version X.Y.Z or above, which would require hardcoding a list of directives and minimum versions...), and IdentityFile (also like SendEnv, it can appear multiple times).

I don't have any of those in my configs, so can't test them.

This is REALLY useful, and thank you for your excellent work!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants