Class: SSHKit::Backend::NetsshGlobal

Inherits:
Netssh
  • Object
show all
Defined in:
lib/sshkit/backends/netssh_global.rb

Defined Under Namespace

Classes: Configuration

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.configObject



16
17
18
# File 'lib/sshkit/backends/netssh_global.rb', line 16

def config
  @config ||= Configuration.new
end

Instance Method Details

#upload!(local, remote, options = {}) ⇒ Object



23
24
25
26
27
28
29
30
31
# File 'lib/sshkit/backends/netssh_global.rb', line 23

def upload!(local, remote, options = {})
  execute :setfacl, "-m u:#{ssh_user}:rwx #{File.dirname(remote)}; true"
  execute :setfacl, "-m u:#{ssh_user}:rw #{remote}; true"
  super
  as :root do
    # Required as uploaded file is owned by SSH user, not owner
    execute :chown, property(:owner), remote
  end
end