Documentation
¶
Overview ¶
Package ssh is a transport.Interface implementation, which forwards given addresses over specified SSH host.
Index ¶
Constants ¶
View Source
const ( // User is a default user used for SSH connections. User = "root" // ConnectionTimeout is a default time SSH will wait while connecting to unreachable server. ConnectionTimeout = "30s" // RetryTimeout is a default time after we give up connecting to unreachable server. RetryTimeout = "60s" // RetryInterval is a default time how long we wait between SSH connection attempts. RetryInterval = "1s" // Port is a default port used for SSH connections. Port = 22 )
View Source
const (
// SSHAuthSockEnv is environment variable name used for connecting to ssh-agent.
SSHAuthSockEnv = "SSH_AUTH_SOCK"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Address is a hostname or IP address which should be used for connection. Address string `json:"address,omitempty"` // Port defines which port should be used for SSH connection. Port int `json:"port,omitempty"` // User defines as which user the connection should authenticate. User string `json:"user,omitempty"` // Password adds password as one of available authentication methods. Password string `json:"password,omitempty"` // ConnectionTimeout defines time, after which SSH client gives up single attempt for connecting. ConnectionTimeout string `json:"connectionTimeout,omitempty"` // RetryTimeout defines after what time connecting should give up, if trying to connect to unreachable // host. RetryTimeout string `json:"retryTimeout,omitempty"` // RetryInterval defines how long to wait between connection attempts. RetryInterval string `json:"retryInterval,omitempty"` // PrivateKey adds private key as authentication method. // It must be defined as valid SSH private key in PEM format. PrivateKey string `json:"privateKey,omitempty"` }
Config represents SSH transport configuration.
All fields are required. Use BuildConfig to pre-fill the configuration with default values.
func BuildConfig ¶
BuildConfig takes destination SSH configuration, struct with default values provided by the user and merges it together with global SSH default values.
Click to show internal directories.
Click to hide internal directories.