class Synco::Shells::SSH

SSH shell provides access to a remote server using SSH.

Public Class Methods

new(*command, arguments: [], port: nil, key: nil, user: nil, batch_mode: nil, **options) click to toggle source
Calls superclass method Synco::Shell::new
# File lib/synco/shells/ssh.rb, line 31
def initialize(*command, arguments: [], port: nil, key: nil, user: nil, batch_mode: nil, **options)
        if port
                arguments << '-p' << port
        end
        
        if key
                arguments << '-i' << key
        end
        
        if user
                arguments << '-l' << user
        end
        
        unless batch_mode.nil?
                arguments << '-o' << "BatchMode=#{batch_mode ? 'yes' : 'no'}"
        end
        
        super
end

Public Instance Methods

default_command() click to toggle source
# File lib/synco/shells/ssh.rb, line 27
def default_command
        ['ssh']
end