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 file parser #64

Merged
merged 3 commits into from
Sep 28, 2017
Merged

SSH config file parser #64

merged 3 commits into from
Sep 28, 2017

Conversation

ailzhang
Copy link
Collaborator

Support parsing ssh config files for et to use. User-specific config file(~/.ssh/config) has higher priority than system-wide config file(/etc/ssh/ssh_config).
Currently these options below are parsed. Hostname field is used to help translate et host field.
For example, if you have a hostname alias dev for someremotemachine.com. you can now do et dev:8080 instead of et someremotemachine.com:8080.
Support for other config options can be added based on request(such as jumphost).

Include (to include another config file)
Host
Hostname
port
username
connecttimeout
protocol
stricthostkeychecking
userknownhostsfile
proxycommand
GSSAPISeverIdentity
GSSAPIClientIdentity
GSSAPIDelegateCredentials

Copy link
Owner

@MisterTea MisterTea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to go with a minor change, thanks!

/* First parse user-specific ssh config, then system-wide config. */
parse_ssh_config_file(&options, string(home_dir) + "/.ssh/config");
parse_ssh_config_file(&options, "/etc/ssh/ssh_config");
cout << "connecting to " << options.host << endl;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to LOG(INFO). If we want to print to cout, that's fine but let's also add a LOG(INFO) line so it gets logged to file as well.

@ailzhang
Copy link
Collaborator Author

Fixed :) There are also some cout for error message before exiting in ParseConfigFile.hpp. I feel it's good to output sth before exiting, let me know if you would like them to be logged as well. Thanks!

@MisterTea MisterTea merged commit 9b46ac0 into master Sep 28, 2017
@MisterTea
Copy link
Owner

Thanks!

@ailzhang ailzhang deleted the sshconfig branch March 6, 2018 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants