Phlip
8/2/2008 6:21:00 PM
Shashank Agarwal wrote:
> Is there a way to read a file over SSH? I looked at the net/ssh library
> but couldn't put together a working code.
Here's a wild guess - does it help?
require 'net/ssh'
require 'net/sftp'
Net::SSH.start( 'myserver', 'myname', 'mypassword' ) do |session|
session.sftp.connect do |sftp|
sftp.get_file('path/filename', 'filename')
end
end
--
Phlip