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

~/.ssh/config Include directive being ignored #280

Open
Smylers opened this issue Jun 14, 2023 · 0 comments
Open

~/.ssh/config Include directive being ignored #280

Smylers opened this issue Jun 14, 2023 · 0 comments

Comments

@Smylers
Copy link

Smylers commented Jun 14, 2023

When processing the ~/.ssh/config file, sshtunnel appears not to act on the Include directive, to load further config from a different file. This means it uses different SSH config from the ssh command making a connection to the same server.

My set-up is generic SSH config in ~/.ssh/config, which ends with this to include further config:

Include ~/.ssh/local_config

(That's so that the first file can be copied to all computers I use, shared with others, and so on. The second file contains anything to do with specific user accounts or hosts, which varies and may be private.)

I think sshtunnel isn't using the config from the included file, so is trying to connect using the wrong username (and therefore failing). This is with version 0.4.0.

The relevant config is acted on if temporarily pasted into ~/.ssh/config itself; and it also uses it if I specify sshtunnel -c ~/.ssh/local_config — but that then obviously misses out settings from the main ~/.ssh/config file.

To reproduce:

  1. Have somewhere to SSH to which requires a config directive, for instance a username which is different from the local username.
  2. Put that config in its own file, and Include that file from ~/.ssh/config.
  3. Use ssh to connect, and see that it works, taking the config from the included file.
  4. End that connection and use sshtunnel, finding that it fails (and using a -v or 2 to see what it's doing, for instance trying the wrong username).
  5. Move that config into the min ~/.ssh/config and verify that both ssh and sshtunnel now use it.

Please could sshtunnel support Include? Thanks.

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