-
Notifications
You must be signed in to change notification settings - Fork 124
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
added ssh option 'keys_only: true' when not using password login issue #232 #233
base: master
Are you sure you want to change the base?
added ssh option 'keys_only: true' when not using password login issue #232 #233
Conversation
ref: #232 |
@@ -257,6 +257,8 @@ def ssh_options | |||
password = STDIN.noecho(&:gets).strip | |||
print "\n" | |||
opts.merge!(password: password) | |||
else | |||
opts.merge!(keys_only: true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please set keys_only: true
only if @options[:key]
is set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, @ryotarai, this is going to work when setting the key via command line but it is going to fail when the key is set by ssh config.
Is this the intended behaviour?
@@ -257,6 +257,8 @@ def ssh_options | |||
password = STDIN.noecho(&:gets).strip | |||
print "\n" | |||
opts.merge!(password: password) | |||
else | |||
opts.merge!(keys_only: true) if @options[:key] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nits] opts[:keys]
is better than @options[:key]
in this context
From https://net-ssh.github.io/ssh/v2/api/classes/Net/SSH.html
:keys_only => set to true to use only private keys from keys and key_data parameters, even if ssh-agent offers more identities. This option is intended for situations where ssh-agent offers many different identites.