Documentation ¶
Index ¶
- type SSHClient
- func (c *SSHClient) Close() (bool, error)
- func (c *SSHClient) Connect(host string, port int, username, password string) (bool, error)
- func (c *SSHClient) ConnectSSHInfoMode(host string, port int) (*ssh.HandshakeLog, error)
- func (c *SSHClient) ConnectWithKey(host string, port int, username, key string) (bool, error)
- func (c *SSHClient) Run(cmd string) (string, error)
- func (c *SSHClient) SetTimeout(sec int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SSHClient ¶
SSHClient is a client for SSH servers.
Internally client uses github.com/zmap/zgrab2/lib/ssh driver.
func (*SSHClient) Close ¶ added in v3.1.0
Close closes the SSH connection and destroys the client
Returns the success state and error. If error is not nil, state will be false
func (*SSHClient) Connect ¶
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
func (*SSHClient) ConnectSSHInfoMode ¶
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
func (*SSHClient) ConnectWithKey ¶
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
func (*SSHClient) Run ¶ added in v3.1.0
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
func (*SSHClient) SetTimeout ¶ added in v3.1.1
SetTimeout sets the timeout for the SSH connection in seconds