sshkit v0.0.1 SSHKit.SSH.Connection

Summary

Functions

Closes an SSH connection

Opens a connection to an SSH server

Opens a new connection, based on the parameters of an existing one

Functions

close(connection)

Closes an SSH connection.

Returns :ok.

For details, see :ssh_connection.close/2.

open(host, options \\ [])

Opens a connection to an SSH server.

A timeout in ms can be provided through the :timeout option. The default value is :infinity.

A few more, common options are :port, :user and :password. Port defaults to 22, user to $LOGNAME or $USER on UNIX, $USERNAME on Windows.

The :user_interaction option is set to false by default.

For a complete list of options and their default values, see: :ssh.connect/4.

Returns {:ok, conn} on success, {:error, reason} otherwise.

reopen(connection, options \\ [])

Opens a new connection, based on the parameters of an existing one.

The timeout value of the original connection is discarded. Other connection options are reused and may be overriden.

Uses SSHKit.SSH.open/2.

Returns {:ok, conn} or {:error, reason}.