Secure Shell (SSH)

SSH interfaces.

class SSHClient

SSH client.

login(target, private_key_path)

Create a session.

Parameters:
Return type:

SSHPhysicalSession

Returns:

The physical SSH session.

Raises:

caviar.network.ssh.SSHUnavailableSessionError – If not any session is available.

close()

Close this client.

class SSHPhysicalSession

SSH physical session.

execute(cmd)

Executes a comand

Parameters:cmd (str) – Command to be executed.
Return type:tuple
Returns:Tuple of stdout and stderr.
Raises:caviar.network.ssh.SSHInvalidSessionError – If the current session is invalid.
logout()

Log out.