Hal Fulton wrote:
> Thanks Jamis, Tom, Josh, Ara...
> 
> "The details are in the -devel."
> 
> This little test now works:
> 
>   $ ruby -ropenssl -e "p OpenSSL::PKey::DH.instance_method(:g)"
>   #<UnboundMethod: OpenSSL::PKey::DH#g>
> 
> And here's what that little script is doing now:
> 

Ah, yes. This is on my TODO list. I suspect, if you were to do a cat on 
your private key (.ssh/id_rsa), you would see (in addition to a lot of 
base64 encoded gibberish) some "Name: Value" pairs in your key... 
(please check, if you don't mind) If you don't, then there is something 
else afoot. If you do, then that's the problem, and I would REALLY 
appreciate it if you could send me the exact command you used to 
generate that key so I can try to duplicate this problem... :)

What I mean is the following. Net::SSH understands private key files of 
the following format:

-----BEGIN RSA PRIVATE KEY-----
MIICWgIBAAKBgQClJtD8rqQ4A6s85CsD8DfLZ1bMlPRpGeppvG/+JlOlwjPvWLqQ
jAI5IpqcSr83BXlrZTMleKh3oKvuaAEm+I8JVjG/FmX87I56MVWGKXWozQtfoJCq
...[snip]...
D7nq578W5BbXwbZTAkAz+2ubnchiHHPwDFZzVdOcecut45fpVzK7YGr0oBVxTFfI
ThcI61E7U1qr64WJjXAsSznVolCysMhL5esyqr0B
-----END RSA PRIVATE KEY-----

However, some keys seem to possess name/value pairs just after the BEGIN 
RSA PRIVATE KEY section:

-----BEGIN RSA PRIVATE KEY-----
Something: Like-This
And: Something-Else

MIICWgIBAAKBgQClJtD8rqQ4A6s85CsD8DfLZ1bMlPRpGeppvG/+JlOlwjPvWLqQ
jAI5IpqcSr83BXlrZTMleKh3oKvuaAEm+I8JVjG/FmX87I56MVWGKXWozQtfoJCq
...[snip]...
D7nq578W5BbXwbZTAkAz+2ubnchiHHPwDFZzVdOcecut45fpVzK7YGr0oBVxTFfI
ThcI61E7U1qr64WJjXAsSznVolCysMhL5esyqr0B
-----END RSA PRIVATE KEY-----

Net::SSH knows how to parse out the name/value pairs, but it doesn't 
know what to do with them, and since I've never been able to generate a 
key that has those name/value pairs, I can't duplicate the problem. :(

What REALLY needs to happen is I need to write some code that will query 
the active ssh-agent (if one is running) and have the agent give me all 
the info I need about the keys.

Like I said, it's on my TODO list. The workaround is to specify the 
username/password in your script, or to generate a key that doesn't have 
the name/value pairs in them.

Gotta love experimental software. :)


-- 
Jamis Buck
jgb3 / email.byu.edu
http://www.jamisbuck.org/jamis

"I use octal until I get to 8, and then I switch to decimal."