ssh
- ssh
SSHClient.Close()⇒boolean.Connect(host, port, username, password)⇒boolean.ConnectSSHInfoMode(host, port)⇒HandshakeLog.ConnectWithKey(host, port, username, key)⇒boolean.Run(cmd)⇒string.SetTimeout(sec)
HandshakeLog:object
(ssh).SSHClient
SSHClient is a client for SSH servers. Internally client uses github.com/zmap/zgrab2/lib/ssh driver. Kind: inner class ofssh
SSHClient.Close()⇒boolean.Connect(host, port, username, password)⇒boolean.ConnectSSHInfoMode(host, port)⇒HandshakeLog.ConnectWithKey(host, port, username, key)⇒boolean.Run(cmd)⇒string.SetTimeout(sec)
sshClient.Close() ⇒ boolean
Close closes the SSH connection and destroys the client
Kind: instance method of SSHClientReturns:
boolean - - The success state of the operation.Throws:
error- The error encountered during the operation.
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 SSHClientReturns:
boolean - - The success state of the operation.Throws:
error- The error encountered during the operation.
| Param | Type | Description |
|---|---|---|
| host | string | The host to connect to. |
| port | number | The port to connect to. |
| username | string | The username for the connection. |
| password | string | The password for the connection. |
sshClient.ConnectSSHInfoMode(host, port) ⇒ HandshakeLog
ConnectSSHInfoMode tries to connect to provided host and port with provided host and port
Kind: instance method of SSHClientReturns:
HandshakeLog - - The HandshakeLog object containing information about the ssh connection.Throws:
error- The error encountered during the operation.
| Param | Type | Description |
|---|---|---|
| host | string | The host to connect to. |
| port | number | The port to connect to. |
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 SSHClientReturns:
boolean - - The success state of the operation.Throws:
error- The error encountered during the operation.
| Param | Type | Description |
|---|---|---|
| host | string | The host to connect to. |
| port | number | The port to connect to. |
| username | string | The username for the connection. |
| key | string | The private key for the connection. |
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 SSHClientReturns:
string - - The output of the command.Throws:
error- The error encountered during the operation.
| Param | Type | Description |
|---|---|---|
| cmd | string | The command to execute. |
sshClient.SetTimeout(sec)
SetTimeout sets the timeout for the SSH connection in seconds Kind: instance method ofSSHClient
| Param | Type | Description |
|---|---|---|
| sec | number | The number of seconds for the timeout. |
(ssh).HandshakeLog : object
HandshakeLog is a struct that contains information about the ssh connection.
Kind: inner typedef of ssh