Ssh
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 of 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)
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.
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. |
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.
Param | Type | Description |
---|---|---|
host | string | The host to connect to. |
port | number | The port to connect to. |
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.
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. |
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.
Param | Type | Description |
---|---|---|
cmd | string | The command to execute. |
Example
sshClient.SetTimeout(sec)
SetTimeout sets the timeout for the SSH connection in seconds
Kind: instance method of SSHClient
Param | Type | Description |
---|---|---|
sec | number | The number of seconds for the timeout. |
Example
(ssh).HandshakeLog : object
HandshakeLog is a struct that contains information about the ssh connection.
Kind: inner typedef of ssh
Was this page helpful?