Documentation ¶
Index ¶
- func MakeClientConfig(username string, auth []ssh.AuthMethod) *ssh.ClientConfig
- func PasswordKey(username, password string) *ssh.ClientConfig
- func PrivateKey(username, path string) (*ssh.ClientConfig, error)
- func PrivateKeyPassphrase(username, passphrase, path string) (*ssh.ClientConfig, error)
- type Connect
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeClientConfig ¶ added in v1.0.0
func MakeClientConfig(username string, auth []ssh.AuthMethod) *ssh.ClientConfig
MakeClientConfig makes a new ssh.ClientConfig.
func PasswordKey ¶
func PasswordKey(username, password string) *ssh.ClientConfig
PasswordKey returns the ssh.ClientConfig based on specified username and password.
func PrivateKey ¶
func PrivateKey(username, path string) (*ssh.ClientConfig, error)
PrivateKey loads a public key from "path" and returns a SSH ClientConfig to authenticate with the server.
func PrivateKeyPassphrase ¶
func PrivateKeyPassphrase(username, passphrase, path string) (*ssh.ClientConfig, error)
PrivateKeyPassphrase returns the ssh.ClientConfig based on specified username, passphrase and path.
Types ¶
type Connect ¶ added in v1.0.0
type Connect struct { // Client *ssh.Client Client *ssh.Client // ProxyDialer ProxyDialer proxy.Dialer }
Connect structure to store contents about ssh connection.
func (*Connect) CreateClient ¶ added in v1.0.0
func (c *Connect) CreateClient(addr string, cc *ssh.ClientConfig) error
CreateClient connects to the remote SSH server, returns error if it couldn't establish a session to the SSH server.
Click to show internal directories.
Click to hide internal directories.