I get this error when I try to use a key with a pass phrase.  The top of 
my encrypted key has this key value pair:
Proc-Type: 4,ENCRYPTED

I have a patch for Net::SSH that lets you specify alternate keys to use 
so I can generate a key without a pass phrase to test with.



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:
> 
> 
> $ ruby ssh1.rb
> /usr/local/lib/ruby/gems/1.8/gems/net-ssh-0.0.3/lib/net/ssh/openssl.rb:80:in 
> `initialize': Neither PUB key nor PRIV key:: header too long  
> (OpenSSL::PKey::RSAError)
>           from 
> /usr/local/lib/ruby/gems/1.8/gems/net-ssh-0.0.3/lib/net/ssh/openssl.rb:80:in 
> `new'
>         from 
> /usr/local/lib/ruby/gems/1.8/gems/net-ssh-0.0.3/lib/net/ssh/openssl.rb:80:in 
> `load_private_key'
>         from 
> /usr/local/lib/ruby/gems/1.8/gems/net-ssh-0.0.3/lib/net/ssh.rb:196:in 
> `load_key'
>         from 
> /usr/local/lib/ruby/gems/1.8/gems/net-ssh-0.0.3/lib/net/ssh.rb:193:in 
> `each'
>         from 
> /usr/local/lib/ruby/gems/1.8/gems/net-ssh-0.0.3/lib/net/ssh.rb:193:in 
> `load_key'
>         from 
> /usr/local/lib/ruby/gems/1.8/gems/net-ssh-0.0.3/lib/net/ssh.rb:121:in 
> `open'
>         from 
> /usr/local/lib/ruby/gems/1.8/gems/net-ssh-0.0.3/lib/net/ssh.rb:121:in 
> `each'
>         from 
> /usr/local/lib/ruby/gems/1.8/gems/net-ssh-0.0.3/lib/net/ssh.rb:121:in 
> `open'
>         from 
> /usr/local/lib/ruby/gems/1.8/gems/net-ssh-0.0.3/lib/net/ssh.rb:67:in 
> `start'
>         from ssh1.rb:7
> 
> 
> 

-- 
Daniel Hobe <daniel / nightrunner.com>
http://www.nightrunner.com