Class Net::SSH::Connection::Session
In: lib/net/sftp.rb
Parent: Object

Methods

sftp  

Public Instance methods

A convenience method for starting up a new SFTP connection on the current SSH session. Blocks until the SFTP session is fully open, and then returns the SFTP session.

  Net::SSH.start("localhost", "user", "password") do |ssh|
    ssh.sftp.upload!("/local/file.tgz", "/remote/file.tgz")
    ssh.exec! "cd /some/path && tar xf /remote/file.tgz && rm /remote/file.tgz"
  end

[Source]

    # File lib/net/sftp.rb, line 53
53:   def sftp(wait=true)
54:     @sftp ||= begin
55:       sftp = Net::SFTP::Session.new(self)
56:       sftp.connect! if wait
57:       sftp
58:     end
59:   end

[Validate]