Skip to content

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

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?

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