class SSH

Overview

SSH client

Defined in:

ssh.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(host : String, user : String, port : Int32 = 22, socket : TCPSocket = TCPSocket.new(host, port, connect_timeout: 5)) #

[View source]

Class Method Detail

def self.open(host, user, port = 22, &) #

[View source]

Instance Method Detail

def channel(&) #

Open a session channel


[View source]
def close : Nil #

[View source]
def exec(cmd, &blk : Bytes, Bool -> Nil) : Int32 | Nil #

Execute a command on the server, and retrive the stdout/stderr in the block Returns the exit status of the command


[View source]
def exec!(cmd) : Tuple(String, Int32 | Nil) #

Execute a command on the server Returns the output of stdout and stderr into a single string and the exit status


[View source]
def finalize #

[View source]
def host : String #

[View source]
def port : Int32 #

[View source]
def user : String #

[View source]