ssh.SSHClient
SSHClient is a client for SSH servers. Internally client uses github.com/zmap/zgrab2/lib/ssh driver.
Example
• new SSHClient(): SSHClient
ssh.ts:16
▸ Close(): boolean
Close closes the SSH connection and destroys the client Returns the success state and error. If error is not nil, state will be false
boolean
Example
ssh.ts:118
▸ Connect(host
, port
, username
): boolean
Connect tries to connect to provided host and port with provided username and password with ssh. Returns state of connection and error. If error is not nil, state will be false
Name | Type |
---|---|
host | string |
port | number |
username | string |
boolean
Example
ssh.ts:43
▸ ConnectSSHInfoMode(host
, port
): HandshakeLog
ConnectSSHInfoMode tries to connect to provided host and port with provided host and port Returns HandshakeLog and error. If error is not nil, state will be false HandshakeLog is a struct that contains information about the ssh connection
Name | Type |
---|---|
host | string |
port | number |
Example
ssh.ts:81
▸ ConnectWithKey(host
, port
, username
): boolean
ConnectWithKey tries to connect to provided host and port with provided username and private_key. Returns state of connection and error. If error is not nil, state will be false
Name | Type |
---|---|
host | string |
port | number |
username | string |
boolean
Example
ssh.ts:61
▸ Run(cmd
): string
Run tries to open a new SSH session, then tries to execute the provided command in said session Returns string and error. If error is not nil, state will be false The string contains the command output
Name | Type |
---|---|
cmd | string |
string
Example
ssh.ts:101
▸ SetTimeout(sec
): void
SetTimeout sets the timeout for the SSH connection in seconds
Name | Type |
---|---|
sec | number |
void
Example
ssh.ts:26
ssh.SSHClient
SSHClient is a client for SSH servers. Internally client uses github.com/zmap/zgrab2/lib/ssh driver.
Example
• new SSHClient(): SSHClient
ssh.ts:16
▸ Close(): boolean
Close closes the SSH connection and destroys the client Returns the success state and error. If error is not nil, state will be false
boolean
Example
ssh.ts:118
▸ Connect(host
, port
, username
): boolean
Connect tries to connect to provided host and port with provided username and password with ssh. Returns state of connection and error. If error is not nil, state will be false
Name | Type |
---|---|
host | string |
port | number |
username | string |
boolean
Example
ssh.ts:43
▸ ConnectSSHInfoMode(host
, port
): HandshakeLog
ConnectSSHInfoMode tries to connect to provided host and port with provided host and port Returns HandshakeLog and error. If error is not nil, state will be false HandshakeLog is a struct that contains information about the ssh connection
Name | Type |
---|---|
host | string |
port | number |
Example
ssh.ts:81
▸ ConnectWithKey(host
, port
, username
): boolean
ConnectWithKey tries to connect to provided host and port with provided username and private_key. Returns state of connection and error. If error is not nil, state will be false
Name | Type |
---|---|
host | string |
port | number |
username | string |
boolean
Example
ssh.ts:61
▸ Run(cmd
): string
Run tries to open a new SSH session, then tries to execute the provided command in said session Returns string and error. If error is not nil, state will be false The string contains the command output
Name | Type |
---|---|
cmd | string |
string
Example
ssh.ts:101
▸ SetTimeout(sec
): void
SetTimeout sets the timeout for the SSH connection in seconds
Name | Type |
---|---|
sec | number |
void
Example
ssh.ts:26