Rye - how to use passphrase?

Hi All,

I’m new here, so excuse me if I am breaking one of the rules of
etiquette. Direct me to the right place, if so.

I’m using Rye::Box for my QA automation and I’ve run into an issue when
attempting to add private ssh keys. It will not accept the
Net::SSH.start :passphrase argument in order to add the key to my agent.

Anyone know how to use a private ssh key with a passphrase in Rye? I
need to load the ssh key programmatically because the key itself is
create during the execution of the automation.

oR = Rye::Box.new(sHost, :user=>sUser, :keys=>sKeyfile,
:passphrase=>sPassPhrase)
puts oR.ls

I get prompted for the passphrase instead of it looking to the
:passphrase argument.

On 10/18/2010 11:22 AM, Terevos Gmail wrote:

need to load the ssh key programmatically because the key itself is
create during the execution of the automation.

oR = Rye::Box.new(sHost, :user=>sUser, :keys=>sKeyfile,
:passphrase=>sPassPhrase)
puts oR.ls

I get prompted for the passphrase instead of it looking to the
:passphrase argument.

According to the docs, it’s :password, not :passphrase.
http://rye.rubyforge.org/classes/Rye/Box.html

-Justin

Justin C. wrote in post #955212:

According to the docs, it’s :password, not :passphrase.
http://rye.rubyforge.org/classes/Rye/Box.html

-Justin

According to the docs, it says: “:password => the user’s password
(ignored if there’s a valid private key)”

So I assumed it would be ignored when using a private key. I’ve just
tried using :password with the same result.

oR = Rye::Box.new(sHost, :user=>sUser, :keys=>sKeyfile,
:passphrase=>sPassPhrase)
puts oR.ls

I get prompted for the passphrase instead of it looking to the
:passphrase argument.

I just fixed a bug related to this and pushed it in the 0.9.1 release.
Your example should work as expected now. If not let me know!

The reason it was still prompting for the passphrase is b/c Rye also
added the specified private key(s) to ssh-agent (legacy reasons). Here’s
the related commit:

Delano

Delano Mandelbaum wrote in post #955279:

I just fixed a bug related to this and pushed it in the 0.9.1 release.
Your example should work as expected now. If not let me know!

The reason it was still prompting for the passphrase is b/c Rye also
added the specified private key(s) to ssh-agent (legacy reasons). Here’s
the related commit:
Release 0.9.1 (Don't add keys to ssh-agent in Rye::Box and Rye::Set) · delano/rye@3192a20 · GitHub

Delano

Someone give this guy a medal. Same day bug report and fix!