Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrBadServerKeyMsg = "server key for given host differs from key in known_host" ErrUnknownServerKeyMsg = "server key not found in known_hosts" )
Functions ¶
func NewSSHClientConfig ¶
Types ¶
type Config ¶
type Config struct { Identity string PassPhrase string PasswordCallback PasswordCallback PassPhraseCallback PassPhraseCallback HostKeyCallback HostKeyCallback }
type ContextDialer ¶
type ContextDialer interface {
DialContext(ctx context.Context, network, address string) (net.Conn, error)
}
func NewDialContext ¶
NewDialContext allows access to docker daemon in a remote machine using SSH.
It creates a new ContextDialer which dials docker daemon in the remote and also returns Docker Host URI as seen by the remote.
Knowing the Docker Host is useful when mounting docker socket into a container.
Dialing the remote docker daemon can be done in two ways:
- Use SSH to tunnel Unix/TCP socket.
- Use SSH to execute the "docker system dial-stdio" command in the remote and forward its stdio.
The tunnel method is used whenever possible. The "stdio" method is used as a fallback when tunneling is not possible: e.g. when remote uses Windows' named pipe.
When tunneling is used all connection dialed by the returned ContextDialer are tunneled via single SSH connection. The connection should be disposed when dialer is no longer needed.
For this reason returned ContextDialer may also implement io.Closer. Caller of this function should check if the returned ContextDialer is also an instance of io.Closer and call Close() on it if it is.
type DialContextFn ¶
type HostKeyCallback ¶
func NewHostKeyCbk ¶
func NewHostKeyCbk() HostKeyCallback
type PassPhraseCallback ¶
func NewPassPhraseCbk ¶
func NewPassPhraseCbk() PassPhraseCallback
type PasswordCallback ¶
func NewPasswordCbk ¶
func NewPasswordCbk() PasswordCallback