Documentation ¶
Overview ¶
Package sshc provides sshc.NewClient() that returns *ssh.Client using ssh_config(5)
Index ¶
- func Dial(dc *DialConfig) (*ssh.Client, error)
- func NewClient(host string, options ...Option) (*ssh.Client, error)
- type Config
- type DialConfig
- type Option
- func AppendConfigPath(p string) Option
- func AuthMethod(m ssh.AuthMethod) Option
- func ClearConfigPath() Option
- func ConfigPath(p string) Option
- func Hostname(h string) Option
- func IdentityFile(p string) Option
- func IdentityKey(b []byte) Option
- func Knownhosts(files ...string) Option
- func Passphrase(p []byte) Option
- func Password(pass string) Option
- func Port(p int) Option
- func UnshiftConfigPath(p string) Option
- func UseAgent(u bool) Option
- func User(u string) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config is the type for the SSH Client config. not ssh_config.
type DialConfig ¶
type Option ¶
Option is the type for change Config.
func AppendConfigPath ¶
AppendConfigPath returns Option that append ssh_config path to Config.configpaths.
func AuthMethod ¶ added in v3.1.0
func AuthMethod(m ssh.AuthMethod) Option
AuthMethod returns Option that append ssh.AuthMethod to Config.auth
func ClearConfigPath ¶
func ClearConfigPath() Option
ClearConfigPath returns Option thet clear Config.configpaths,
func IdentityFile ¶
IdentityFile returns Option that set Config.identityKey for override SSH client identity file.
func IdentityKey ¶
IdentityKey returns Option that set Config.identityKey for override SSH client identity file.
func Knownhosts ¶
Knownhosts returns Option that override Config.knownhosts.
func Passphrase ¶
Passphrase returns Option that set Config.passphrase for set SSH key passphrase.
func UnshiftConfigPath ¶
UnshiftConfigPath returns Option that unshift ssh_config path to Config.configpaths.