Documentation ¶
Index ¶
- func CreateFromPrivateKeyContent(user string, privateKey []byte, passphrase ...string) (*ssh.ClientConfig, error)
- func CreateFromPrivateKeyFile(user string, privateKeyFile string, passfphrase ...string) (*ssh.ClientConfig, error)
- func CreateFromUserPassword(user, pwd string) *ssh.ClientConfig
- type Client
- type SSHtunnel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateFromPrivateKeyContent ¶
func CreateFromPrivateKeyContent(user string, privateKey []byte, passphrase ...string) (*ssh.ClientConfig, error)
CreateFromPrivateKeyContent create using private key content
func CreateFromPrivateKeyFile ¶
func CreateFromPrivateKeyFile(user string, privateKeyFile string, passfphrase ...string) (*ssh.ClientConfig, error)
CreateFromPrivateKeyFile create using private key from file
func CreateFromUserPassword ¶
func CreateFromUserPassword(user, pwd string) *ssh.ClientConfig
CreateFromUserPassword connect via user password
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
A Client implements an SSH client that supports running commands and scripts remotely.
func (*Client) Cmd ¶
Cmd creates a RemoteScript that can run the command on the client. The cmd string is split on newlines and each line is executed separately.
func (*Client) UploadFile ¶
UploadFile upload file to remote via ftp
type SSHtunnel ¶
type SSHtunnel struct { Local *connectionEndpoint Server *connectionEndpoint Remote *connectionEndpoint Config *ssh.ClientConfig // contains filtered or unexported fields }
SSHtunnel define local remote server and remote resource to use
func CreateTunnel ¶
func CreateTunnel(localPort int, resourceHost string, resourcePort int, intermediateServerHost string, intermediateServerPort int, sshConf *ssh.ClientConfig) (*SSHtunnel, error)
CreateTunnel a tunnel via an intermediateServer
Click to show internal directories.
Click to hide internal directories.