[ANN] Net::SSH 0.6.0

Here's another release of Net::SSH, your friendly neighborhood pure-Ruby SSH2 client protocol implementation.

This release includes support for the PuTTY "pageant" process under Windows, thanks to Guillaume Marçais. It also includes support for external services, like Net::SFTP.

   project page: http://rubyforge.org/projects/net-ssh
   user manual: http://net-ssh.rubyforge.org
   api docs: http://net-ssh.rubyforge.rog/api

Enjoy!

- Jamis

···

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

Jamis Buck wrote:

Here's another release of Net::SSH, your friendly neighborhood pure-Ruby SSH2 client protocol implementation.

Is this supposed to work on Windows with the 1-click installer?

Running this code:

require 'rubygems'
require 'net/ssh'

Net::SSH.start( 'jamesbritt.com', 'user', 'password' ) do |session|
    result = session.exec( "ls -la " )
    puts result.data
end

I get this error:

c:/ruby/lib/ruby/gems/1.8/gems/net-ssh-0.6.0/lib/net/ssh/transport/ossl/key-factory.rb:52:in `initialize': wrong number of arguments (0 for 1) (ArgumentError)

Thanks,

James

James Britt wrote:

Jamis Buck wrote:

Here's another release of Net::SSH, your friendly neighborhood pure-Ruby SSH2 client protocol implementation.

Is this supposed to work on Windows with the 1-click installer?

Running this code:

require 'rubygems'
require 'net/ssh'

Net::SSH.start( 'jamesbritt.com', 'user', 'password' ) do |session|
   result = session.exec( "ls -la " )
   puts result.data
end

I get this error:

c:/ruby/lib/ruby/gems/1.8/gems/net-ssh-0.6.0/lib/net/ssh/transport/ossl/key-factory.rb:52:in `initialize': wrong number of arguments (0 for 1) (ArgumentError)

It looks like the version of the Ruby/OpenSSL module you have installed is not the right version... The RSA and DSA keys in the version in 1.8.2 allow for a no-argument constructor, whereas prior versions in did, and that's the problem you are seeing.

Try this:

   ruby -ropenssl -e "OpenSSL::PKey::DSA.new"

If that fails, then you know you've got the wrong version. If it succeeds...well, let me know.

- Jamis

···

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

James Britt wrote:
> Jamis Buck wrote:
>> Here's another release of Net::SSH, your friendly neighborhood
>> pure-Ruby SSH2 client protocol implementation.
> Is this supposed to work on Windows with the 1-click installer?

...

It looks like the version of the Ruby/OpenSSL module you have installed
is not the right version... The RSA and DSA keys in the version in 1.8.2
allow for a no-argument constructor, whereas prior versions in did, and
that's the problem you are seeing.

The Windows Installer doesn't include OpenSSL.

-austin

···

On Fri, 3 Dec 2004 00:40:59 +0900, Jamis Buck <jamis_buck@byu.edu> wrote:
--
Austin Ziegler * halostatue@gmail.com
               * Alternate: austin@halostatue.ca

Jamis Buck wrote:

...
It looks like the version of the Ruby/OpenSSL module you have installed is not the right version... The RSA and DSA keys in the version in 1.8.2 allow for a no-argument constructor, whereas prior versions in did, and that's the problem you are seeing.

Try this:

  ruby -ropenssl -e "OpenSSL::PKey::DSA.new"

If that fails, then you know you've got the wrong version. If it succeeds...well, let me know.

c:\> ruby -ropenssl -e "OpenSSL::PKey::DSA.new"
-e:1:in `initialize': wrong number of arguments (0 for 1) (ArgumentError)
         from -e:1:in `new'
         from -e:1

I think we had this discussion during RubyConf2004; I have been unable to locate and install a proper OpenSSL lib.

Should the 1-click installer include SSL libs that Just Work? I may have screwed up my libs in October while trying to get SSH running, but I recently installed the latest 1-click 1.8.2, so I was hoping it would have been bundled with the correct SSL lib.

Has anyone gotten Net:SSH working with the 1-click version?

Thanks,

James

James Britt wrote:

Jamis Buck wrote:

...
It looks like the version of the Ruby/OpenSSL module you have installed is not the right version... The RSA and DSA keys in the version in 1.8.2 allow for a no-argument constructor, whereas prior versions in did, and that's the problem you are seeing.

Try this:

  ruby -ropenssl -e "OpenSSL::PKey::DSA.new"

If that fails, then you know you've got the wrong version. If it succeeds...well, let me know.

c:\> ruby -ropenssl -e "OpenSSL::PKey::DSA.new"
-e:1:in `initialize': wrong number of arguments (0 for 1) (ArgumentError)
        from -e:1:in `new'
        from -e:1

I think we had this discussion during RubyConf2004; I have been unable to locate and install a proper OpenSSL lib.

Should the 1-click installer include SSL libs that Just Work? I may have screwed up my libs in October while trying to get SSH running, but I recently installed the latest 1-click 1.8.2, so I was hoping it would have been bundled with the correct SSL lib.

Has anyone gotten Net:SSH working with the 1-click version?

Well, I have, but only because I compiled the Ruby/OpenSSL module myself. It relies on version 8 of the msvcrt dll, which you may or may not have installed, but if you'd like I can send along (or post) the binary version I created.

- Jamis

···

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

Jamis Buck wrote:

James Britt wrote:

Has anyone gotten Net:SSH working with the 1-click version?

Well, I have, but only because I compiled the Ruby/OpenSSL module myself. It relies on version 8 of the msvcrt dll, which you may or may not have installed, but if you'd like I can send along (or post) the binary version I created.

Thank you; I may take you up on the offer of the binary. I have
numerous copies of msvcrt.dll, though the latest seems to be version
6.something. Where does one get version 8?

I'd be most interested in understanding how to reproduce this myself, in
part because I know of people who are interested in using Ruby for
corporate admin tools, but problems with SSL on Windows hold them back.

I think the ideal situation would be to have the required DLL included
in the 1-click installer; maybe the next best thing is a set of clear
instructions on creating the DLL. And the a pre-compiled binary as a
fall back.

Thanks again,

James

James Britt wrote:

Jamis Buck wrote:

> James Britt wrote:
>>
>> Has anyone gotten Net:SSH working with the 1-click version?
>
>
> Well, I have, but only because I compiled the Ruby/OpenSSL module
> myself. It relies on version 8 of the msvcrt dll, which you may or may
> not have installed, but if you'd like I can send along (or post) the
> binary version I created.

Thank you; I may take you up on the offer of the binary. I have
numerous copies of msvcrt.dll, though the latest seems to be version
6.something. Where does one get version 8?

I'd be most interested in understanding how to reproduce this myself, in
part because I know of people who are interested in using Ruby for
corporate admin tools, but problems with SSL on Windows hold them back.

I think the ideal situation would be to have the required DLL included
in the 1-click installer; maybe the next best thing is a set of clear
instructions on creating the DLL. And the a pre-compiled binary as a
fall back.

I'm planning to incloude OpenSSL in the next time I post a release of the
One-Click Installer. I haven't yet tried to build/integrate OpenSLL, so I
don't know if I'll run into any problems. But when I asked about this on
ruby-talk, the responses seem to indicate I should not have any problems.

Curt

Curt Hibbs wrote:

...
I'm planning to incloude OpenSSL in the next time I post a release of the
One-Click Installer. I haven't yet tried to build/integrate OpenSLL, so I
don't know if I'll run into any problems. But when I asked about this on
ruby-talk, the responses seem to indicate I should not have any problems.

Thank you, that is great news.

BTW, what compiler are you using?

Thanks,

James

Curt Hibbs wrote:

James Britt wrote:

Jamis Buck wrote:

James Britt wrote:

Has anyone gotten Net:SSH working with the 1-click version?

Well, I have, but only because I compiled the Ruby/OpenSSL module
myself. It relies on version 8 of the msvcrt dll, which you may or may
not have installed, but if you'd like I can send along (or post) the
binary version I created.

Thank you; I may take you up on the offer of the binary. I have
numerous copies of msvcrt.dll, though the latest seems to be version
6.something. Where does one get version 8?

I'd be most interested in understanding how to reproduce this myself, in
part because I know of people who are interested in using Ruby for
corporate admin tools, but problems with SSL on Windows hold them back.

I think the ideal situation would be to have the required DLL included
in the 1-click installer; maybe the next best thing is a set of clear
instructions on creating the DLL. And the a pre-compiled binary as a
fall back.

I'm planning to incloude OpenSSL in the next time I post a release of the
One-Click Installer. I haven't yet tried to build/integrate OpenSLL, so I
don't know if I'll run into any problems. But when I asked about this on
ruby-talk, the responses seem to indicate I should not have any problems.

Well, here's the process I went through to get this to work. (Disclaimers: I am NOT a windows developer, nor a windows user, so I may have made things much harder for me than they needed to be. Also, I do not have access to MSVC++, so I used the free commandline tools and the Windows XP SP2 SDK, freely available from MS.)

1) Install the OpenSSL binary for Windows (http://www.slproweb.com/products/Win32OpenSSL.html\) Per the instructions given at that site, I then copied the contents of the 'install' and 'lib/vc' subdirectories to the corresponding system directories (so that the headers and libs are accessible without having to set any INCLUDE or LIB environment variables).

2) Copy the 'ext/openssl' subdirectory from Ruby CVS.

3) I had to tweak mkmf.rb (apparently the version I had was older). I added "header=nil" as the third parameter to the "have_library" method, and passed 'header' as the third argument to #try_func in the same method.

4) I tweaked the ext/openssl/extconf.rb so that the calls to have_library passed "openssl/ssl.h" as the 'header' parameter. (Otherwise, the extconf.rb pass kept failing saying that the OpenSSL_add_all_digests function was not defined. Maybe there is a better way to do this--but I couldn't see any options to cl that said to allow calls to functions without explicit prototypes...)

5) Running extconf.rb worked, at this point, and I got a makefile.

6) Running nmake then built the library.

Quite possibly the problems I encountered had more to do with my ignorance of windows development than anything else, so it may be a much simpler process to build Ruby/OpenSSL under Windows for someone who knows what they are doing.

- Jamis

···

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

James Britt wrote:

Curt Hibbs wrote:
> ...
> I'm planning to incloude OpenSSL in the next time I post a
release of the
> One-Click Installer. I haven't yet tried to build/integrate
OpenSLL, so I
> don't know if I'll run into any problems. But when I asked about this on
> ruby-talk, the responses seem to indicate I should not have any
problems.

Thank you, that is great news.

BTW, what compiler are you using?

I use VC++7.1 (aka Visual Studio .NET 2003). But the one-click installer
includes all required runtime DLLs.

Curt

Thanks Jamis... Having the steps you went through should be a *big* help.

Curt

Jamis Buck wrote:

···

Curt Hibbs wrote:
>
> I'm planning to incloude OpenSSL in the next time I post a
release of the
> One-Click Installer. I haven't yet tried to build/integrate
OpenSLL, so I
> don't know if I'll run into any problems. But when I asked about this on
> ruby-talk, the responses seem to indicate I should not have any
problems.

Well, here's the process I went through to get this to work.
(Disclaimers: I am NOT a windows developer, nor a windows user, so I may
have made things much harder for me than they needed to be. Also, I do
not have access to MSVC++, so I used the free commandline tools and the
Windows XP SP2 SDK, freely available from MS.)

1) Install the OpenSSL binary for Windows
(http://www.slproweb.com/products/Win32OpenSSL.html\) Per the
instructions given at that site, I then copied the contents of the
'install' and 'lib/vc' subdirectories to the corresponding system
directories (so that the headers and libs are accessible without having
to set any INCLUDE or LIB environment variables).

2) Copy the 'ext/openssl' subdirectory from Ruby CVS.

3) I had to tweak mkmf.rb (apparently the version I had was older). I
added "header=nil" as the third parameter to the "have_library" method,
and passed 'header' as the third argument to #try_func in the same method.

4) I tweaked the ext/openssl/extconf.rb so that the calls to
have_library passed "openssl/ssl.h" as the 'header' parameter.
(Otherwise, the extconf.rb pass kept failing saying that the
OpenSSL_add_all_digests function was not defined. Maybe there is a
better way to do this--but I couldn't see any options to cl that said to
allow calls to functions without explicit prototypes...)

5) Running extconf.rb worked, at this point, and I got a makefile.

6) Running nmake then built the library.

Quite possibly the problems I encountered had more to do with my
ignorance of windows development than anything else, so it may be a much
simpler process to build Ruby/OpenSSL under Windows for someone who
knows what they are doing.

- Jamis