[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Net::SSH Failure Vs. 0.6.0

otaku

1/10/2005 3:06:00 AM

Code Producing Errors
==============
require 'needle'
require 'net/ssh'

Net::SSH.start( 'system.domain.com', 9090, 'username', 'password' )
do |session|

session.process.open( "bc" ) do |bc|
dialog = [ "5+5", "7*12", "sqrt(2.000000)", "quit" ]

bc.on_success do |p|
puts "requesting result of #{dialog.first}"
p.puts dialog.shift
end

bc.on_stdout do |p,data|
puts "--> #{data}"
unless dialog.empty?
puts "requesting result of #{dialog.first}"
p.puts dialog.shift
end
end

bc.on_exit do |p, status|
puts "process finished with exit status: #{status}"
end
end

end
==============

SSHD Server Running on Port 9090

===============

Ruby Version:
ruby 1.8.2 (2004-12-25) [powerpc-darwin7.7.0]

===============
OpenSSL Version:
Openssl 0.9.7e
================
ERRORS
======
/usr/local/lib/ruby/site_ruby/1.8/net/ssh/userauth/agent.rb:70:in
`initialize': cannot convert nil into String (TypeError)
from /usr/local/lib/ruby/site_ruby/1.8/net/ssh/userauth/agent.rb:70:in
`open'
from /usr/local/lib/ruby/site_ruby/1.8/net/ssh/userauth/agent.rb:70:in
`connect!'
from
/usr/local/lib/ruby/site_ruby/1.8/net/ssh/userauth/services.rb:51:in
`register_services'
from
/usr/local/lib/ruby/site_ruby/1.8/net/ssh/userauth/services.rb:40:in
`call'
from /usr/local/lib/ruby/site_ruby/1.8/needle/service-point.rb:117:in
`instance'
from /usr/local/lib/ruby/site_ruby/1.8/needle/container.rb:308:in `[]'
from
/usr/local/lib/ruby/site_ruby/1.8/net/ssh/userauth/services.rb:60:in
`open'
from
/usr/local/lib/ruby/site_ruby/1.8/net/ssh/userauth/services.rb:60:in
`open'
.... 6 levels...
from /usr/local/lib/ruby/site_ruby/1.8/net/ssh/session.rb:114:in
`initialize'
from /usr/local/lib/ruby/site_ruby/1.8/net/ssh.rb:47:in `new'
from /usr/local/lib/ruby/site_ruby/1.8/net/ssh.rb:47:in `start'
from /Applications/Downloads2/eclipse/workspace/System/ssh.rb:4

=======
END ERRORS

NOTE OpenSSL Patch Not Applied
assume openssl patch was merged into Ruby 1.8.2 stable
Please Advise:

Otaku.

5 Answers

otaku

1/10/2005 3:15:00 AM

0

Update Added the openssl-snapshot-20040726.tar.bz2 path to Ruby 1.8.2
stable
and I still get the same errors as listed above

using Net::SSH 0.1.0 the above example works

However the above example code does not work with Net::SSH 0.6.0
the above example code is straight out of the Net::SSH documentation
by the maintainer of the project Jamis Buck
any ideas anyone ???......

Otaku

Jamis Buck

1/10/2005 4:28:00 AM

0

On 12:16 Mon 10 Jan , otaku wrote:
> Update Added the openssl-snapshot-20040726.tar.bz2 path to Ruby 1.8.2
> stable
> and I still get the same errors as listed above
>
> using Net::SSH 0.1.0 the above example works
>
> However the above example code does not work with Net::SSH 0.6.0
> the above example code is straight out of the Net::SSH documentation
> by the maintainer of the project Jamis Buck
> any ideas anyone ???......

Yup, this is a bug that has been fixed and will be rolled out in the
upcoming 0.9 release.

The bug occurs because the code always tries to use the agent, even
when no agent is running (or, in your case, when no agent is
needed--you're giving the password explicitly). You can work around
this by doing the following:

Net::SSH.start( 'host', port, 'user', 'password',
:auth_methods => "password"
) do |session|
...
end

In other words, if you explicitly specify the authentication method
you want to use, the agent will never be attempted.

The next release should (hopefully) be ready by late next week, or the
week after that at the VERY latest. (I'm going to be pretty busy this
week, so we'll see what happens.)

Incidentally, if you want to play with the latest version of the code,
it is now being hosted in a subversion repository:

http://www.jamisbuck.org/s...

- Jamis

--
Jamis Buck
jamis_buck@byu.edu
http://www.jamisbuck...
------------------------------
"I am Victor of Borge. You will be assimil-nine-ed."



otaku

1/10/2005 11:24:00 AM

0

Jamis,

thank you for the detailed response
and thank you for the code work around

i will checkout the latest version and test that

i utilize your net-ssh module in a production env to automate a
bazillion tasks and to monitor various
systems

currently i reverted to past known working version of the module
so my scripts still function
your work is greatly appreciated on this project!!!

Otaku

Jamis Buck

1/10/2005 1:14:00 PM

0

On 20:26 Mon 10 Jan , otaku wrote:
> Jamis,
>
> thank you for the detailed response
> and thank you for the code work around
>
> i will checkout the latest version and test that
>
> i utilize your net-ssh module in a production env to automate a
> bazillion tasks and to monitor various
> systems

Ah, a guinea pig! :) I would certainly appreciate your continued bug
reporting, in that case. You can always ask questions to this list,
but bugs for Net::SSH should also be reported to the bug tracker at
http://rubyforge.org/projec... so that they don't get missed.

>
> currently i reverted to past known working version of the module
> so my scripts still function

Good plan. Not that 0.1 is any more stable, in general, than 0.6, but
hopefully the upcoming 0.9 will be more stable than either of those
releases.

> your work is greatly appreciated on this project!!!

Thanks!

- Jamis

--
Jamis Buck
jamis_buck@byu.edu
http://www.jamisbuck...
------------------------------
"I am Victor of Borge. You will be assimil-nine-ed."



otaku

1/11/2005 1:13:00 AM

0

Jamis,

noted on the bug tracking
i will report any future bugs i run into to
the above defined URL

Otaku