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

added ssh option 'keys_only: true' when not using password login issue #232 #233

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

dnlmengs
Copy link

@dnlmengs dnlmengs commented Dec 1, 2016

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.

@ryotarai
Copy link
Member

ryotarai commented Dec 2, 2016

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)
Copy link
Member

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.

Copy link
Author

@dnlmengs dnlmengs Dec 4, 2016

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]
Copy link
Member

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

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