Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Net::SSH does not understand Match blocks #374

Open
djwmarks opened this issue May 18, 2016 · 2 comments
Open

Net::SSH does not understand Match blocks #374

djwmarks opened this issue May 18, 2016 · 2 comments

Comments

@djwmarks
Copy link

I have an SSH configuration including a Match Host block, like the following:

Match Host *.foobar.com
  ProxyCommand command-to-run

The ProxyCommand is only valid within the Match Host context, yet it is configured for every host.

irb(main):001:0> require "net/ssh"
=> true
irb(main):002:0> Net::SSH::Config.for("127.0.0.1")
=> {:auth_methods=>[...], :proxy=>#<Net::SSH::Proxy::Command:0x007f9c0bb5c1e8 @command_line_template="...", @command_line=nil>, :user=>"...", :keys=>["..."], :send_env=>[/^LANG$/, /^LC_.*$/]}

I could maintain separate configuration files but that rather defeats the point of having a configuration parser. Of course the ideal would be that Net::SSH understands the complete syntax. However, if Net::SSH can't understand the full gamut of SSH configuration options, perhaps you could add a methods of blacklisting specific lines as a compromise? Something akin to Rubocop directives, e.g.:

# Net::SSH::Config ignore
Match Host *.foobar.com
  ProxyCommand command-to-run
# Net::SSH::Config clear

This would give people a workaround for future syntax changes as well while the parser catches up.

Cheers

@djwmarks
Copy link
Author

djwmarks commented Aug 1, 2016

PR #413

@mfazekas
Copy link
Collaborator

See also #593

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

No branches or pull requests

2 participants