Skip to main content

ssh

(ssh).SSHClient

SSHClient is a client for SSH servers. Internally client uses github.com/zmap/zgrab2/lib/ssh driver. Kind: inner class of ssh

sshClient.Close() ⇒ boolean

Close closes the SSH connection and destroys the client Kind: instance method of SSHClient
Returns: boolean - - The success state of the operation.
Throws:
  • error - The error encountered during the operation.
Example

sshClient.Connect(host, port, username, password) ⇒ boolean

Connect tries to connect to provided host and port with provided username and password with ssh. Kind: instance method of SSHClient
Returns: boolean - - The success state of the operation.
Throws:
  • error - The error encountered during the operation.
Example

sshClient.ConnectSSHInfoMode(host, port) ⇒ HandshakeLog

ConnectSSHInfoMode tries to connect to provided host and port with provided host and port Kind: instance method of SSHClient
Returns: HandshakeLog - - The HandshakeLog object containing information about the ssh connection.
Throws:
  • error - The error encountered during the operation.
Example

sshClient.ConnectWithKey(host, port, username, key) ⇒ boolean

ConnectWithKey tries to connect to provided host and port with provided username and private_key. Kind: instance method of SSHClient
Returns: boolean - - The success state of the operation.
Throws:
  • error - The error encountered during the operation.
Example

sshClient.Run(cmd) ⇒ string

Run tries to open a new SSH session, then tries to execute the provided command in said session Kind: instance method of SSHClient
Returns: string - - The output of the command.
Throws:
  • error - The error encountered during the operation.
Example

sshClient.SetTimeout(sec)

SetTimeout sets the timeout for the SSH connection in seconds Kind: instance method of SSHClient Example

(ssh).HandshakeLog : object

HandshakeLog is a struct that contains information about the ssh connection. Kind: inner typedef of ssh