require 'net/scp' host = '10.10.10.10' login = 'foo' password = 'bar' Net::SCP.start(host,login,:password => password) do |scp| puts 'SCP Started!' scp.download('/usr/share/ruby.rb','.') end
还有一个scp.upload