class Mina::Backend::Remote

Public Instance Methods

ssh() click to toggle source
# File lib/mina/extras/extra.rb, line 109
def ssh
  ensure!(:domain)
  args = fetch(:domain)
  if fetch(:sudo) && fetch(:sudoer)
    args = "#{fetch(:sudoer)}@#{fetch(:domain)}" if set?(:user)
  else
    args = "#{fetch(:user)}@#{fetch(:domain)}" if set?(:user)
  end
  args += " -i #{fetch(:identity_file)}" if set?(:identity_file)
  args += " -p #{fetch(:port)}" if set?(:port)
  args += ' -A' if set?(:forward_agent)
  args += " #{fetch(:ssh_options)}" if set?(:ssh_options)
  args += ' -tt'
  "ssh #{args}"
end