Net::SSH.start(domain,user,pass) do |session|
result = session.exec( "ls -la" )
puts result.data
puts "-------------------------------------------"
result = session.exec( "ls -la /" )
puts result.data
puts "-------------------------------------------"
result = session.exec( "echo $HOME" )
puts result.data
end
And here's the result:
/usr/local/lib/ruby/gems/1.8/gems/net-ssh-0.0.3/lib/net/ssh/transport/kex/dh.rb:60:in `initialize': wrong number of arguments (0 for 1) (ArgumentError)
from /usr/local/lib/ruby/gems/1.8/gems/net-ssh-0.0.3/lib/net/ssh/transport/kex/dh.rb:60:in `new'
from /usr/local/lib/ruby/gems/1.8/gems/net-ssh-0.0.3/lib/net/ssh/transport/kex/dh.rb:60:in `exchange_keys'
from /usr/local/lib/ruby/gems/1.8/gems/net-ssh-0.0.3/lib/net/ssh/transport/session.rb:292:in `exchange_keys'
from /usr/local/lib/ruby/gems/1.8/gems/net-ssh-0.0.3/lib/net/ssh/transport/session.rb:124:in `initialize'
from /usr/local/lib/ruby/gems/1.8/gems/net-ssh-0.0.3/lib/net/ssh.rb:119:in `new'
from /usr/local/lib/ruby/gems/1.8/gems/net-ssh-0.0.3/lib/net/ssh.rb:119: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
I just installed Net::SSH 0.0.3 and started to play with it.
The first simple thing I tried bombed on me.
All info below.
Jamis or whoever else -- thanks for any assistance.
Cheers,
Hal
(This is FC1 and Ruby 1.8.2)
Here's the script (a trivial mod of one of the examples):
require 'net/ssh'
domain = 'WhoWantsToKnow.com'
user = 'hal'
pass = 'yeah,youwish'
Net::SSH.start(domain,user,pass) do |session|
result = session.exec( "ls -la" )
puts result.data
puts "-------------------------------------------"
result = session.exec( "ls -la /" )
puts result.data
puts "-------------------------------------------"
result = session.exec( "echo $HOME" )
puts result.data
end
And here's the result:
/usr/local/lib/ruby/gems/1.8/gems/net-ssh-0.0.3/lib/net/ssh/transport/kex/dh.rb:60:in `initialize': wrong number of arguments (0 for 1) (ArgumentError)
from /usr/local/lib/ruby/gems/1.8/gems/net-ssh-0.0.3/lib/net/ssh/transport/kex/dh.rb:60:in `new'
from /usr/local/lib/ruby/gems/1.8/gems/net-ssh-0.0.3/lib/net/ssh/transport/kex/dh.rb:60:in `exchange_keys'
from /usr/local/lib/ruby/gems/1.8/gems/net-ssh-0.0.3/lib/net/ssh/transport/session.rb:292:in `exchange_keys'
from /usr/local/lib/ruby/gems/1.8/gems/net-ssh-0.0.3/lib/net/ssh/transport/session.rb:124:in `initialize'
from /usr/local/lib/ruby/gems/1.8/gems/net-ssh-0.0.3/lib/net/ssh.rb:119:in `new'
from /usr/local/lib/ruby/gems/1.8/gems/net-ssh-0.0.3/lib/net/ssh.rb:119: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
Hal,
It looks like you're using an unpatched version of the OpenSSL module for Ruby. One of the changes I submitted to that module was to allow "blank" keys to be created, and initialized later. Previously, the key constructors always required at least one parameter.
Can you please verify that you are, indeed, using 1.8.2? (I assume you mean, by 1.8.2, that you're using a CVS snapshot...?) When did you install it? Could it be that you are using a version that is "old" enough that it doesn't include the patch I submitted?
It looks like you're using an unpatched version of the OpenSSL module for Ruby. One of the changes I submitted to that module was to allow "blank" keys to be created, and initialized later. Previously, the key constructors always required at least one parameter.
Can you please verify that you are, indeed, using 1.8.2? (I assume you mean, by 1.8.2, that you're using a CVS snapshot...?) When did you install it? Could it be that you are using a version that is "old" enough that it doesn't include the patch I submitted?
I think this was a nightly snapshot from a couple of weeks ago. I don't
think I got it directly from CVS, but from the (presumably) auto-generated
.tgz file.
But that was on top of 1.8.1 -- is it possible that my install is screwed
up somehow?
FYI, I installed ssh via the gem.
I downloaded the patch but decided I didn't need it.
Here's a list of some related files with timestamps. What do you think?
It looks like you're using an unpatched version of the OpenSSL module for Ruby. One of the changes I submitted to that module was to allow "blank" keys to be created, and initialized later. Previously, the key constructors always required at least one parameter.
Can you please verify that you are, indeed, using 1.8.2? (I assume you mean, by 1.8.2, that you're using a CVS snapshot...?) When did you install it? Could it be that you are using a version that is "old" enough that it doesn't include the patch I submitted?
I think this was a nightly snapshot from a couple of weeks ago. I don't
think I got it directly from CVS, but from the (presumably) auto-generated
.tgz file.
But that was on top of 1.8.1 -- is it possible that my install is screwed
up somehow?
FYI, I installed ssh via the gem.
I downloaded the patch but decided I didn't need it.
Here's a list of some related files with timestamps. What do you think?
If that gives you an error, then you've got an old version of the OpenSSL module. Installing on top of 1.8.1 MIGHT have caused problems, but I wouldn't have thought so. At any rate, if the above works, then the problem is something else. If it doesn't, then we can take it from there.
If that gives you an error, then you've got an old version of the OpenSSL module. Installing on top of 1.8.1 MIGHT have caused problems, but I wouldn't have thought so. At any rate, if the above works, then the problem is something else. If it doesn't, then we can take it from there.
$ ruby -ropenssl -e "p OpenSSL::PKey::DH.instance_method(:g)"
-e:1:in `instance_method': undefined method `g' for class `OpenSSL::PKey::DH' (NameError)
from -e:1
Umm, I just noticed that the only openssl.so files I have are fairly
old... is the .so supposed to be the same timestamp as the .rb, more
or less?
If that gives you an error, then you've got an old version of the OpenSSL module. Installing on top of 1.8.1 MIGHT have caused problems, but I wouldn't have thought so. At any rate, if the above works, then the problem is something else. If it doesn't, then we can take it from there.
$ ruby -ropenssl -e "p OpenSSL::PKey::DH.instance_method(:g)"
-e:1:in `instance_method': undefined method `g' for class `OpenSSL::PKey::DH' (NameError)
from -e:1
Umm, I just noticed that the only openssl.so files I have are fairly
old... is the .so supposed to be the same timestamp as the .rb, more
or less?
I would certainly expect the .so to have a similar timestamp to the .rb. Perhaps the install was borked somehow? At any rate, it looks like your OpenSSL ruby module is stale.
Umm, I just noticed that the only openssl.so files I have are fairly
old... is the .so supposed to be the same timestamp as the .rb, more
or less?
I would certainly expect the .so to have a similar timestamp to the .rb. Perhaps the install was borked somehow? At any rate, it looks like your OpenSSL ruby module is stale.
OK, thanks, I will rebuild and try it again after lunch.