9行代码实现scp

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

#gem install net-ssh
#gem install net-sftp

require 'rubygems'
require 'net/ssh'
require 'net/sftp'
Net::SSH.start('server', 'username', 'password') do |ssh|
  ssh.sftp.connect do |sftp|
    Dir.foreach('.') do |file|
      puts file
    end
  end
end