sshconfig

package module
v0.0.0-...-da53e50 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 8, 2024 License: BSD-3-Clause Imports: 7 Imported by: 0

README

sshconfig

GoDoc

A simple go library to read SSH configurations from json and similar configuration formats.

License

3-clause BSD

© 2024 Christian Pointner <equinox@spreadspace.org>

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SSHAuthMethod

type SSHAuthMethod struct {
	Password     *string     `json:"password" yaml:"password" toml:"password"`
	PasswordFile *string     `json:"password-file" yaml:"password-file" toml:"password-file"`
	PublicKeys   []SSHSigner `json:"public-keys" yaml:"public-keys" toml:"public-keys"`
}

type SSHBaseConfig

type SSHBaseConfig struct {
	RekeyThreshold uint64   `json:"rekey-threshold" yaml:"rekey-threshold" toml:"rekey-threshold"`
	KeyExchanges   []string `json:"key-exchanges" yaml:"key-exchanges" toml:"key-exchanges"`
	Ciphers        []string `json:"ciphers" yaml:"ciphers" toml:"ciphers"`
	MACs           []string `json:"macs" yaml:"macs" toml:"macs"`
}

type SSHClientConfig

type SSHClientConfig struct {
	SSHBaseConfig
	User              string          `json:"user" yaml:"user" toml:"user"`
	ClientVersion     string          `json:"client-version" yaml:"client-version" toml:"client-version"`
	HostKeyAlgorithms []string        `json:"host-key-algorithms" yaml:"host-key-algorithms" toml:"host-key-algorithms"`
	Timeout           time.Duration   `json:"timeout" yaml:"timeout" toml:"timeout"`
	Auth              []SSHAuthMethod `json:"auth" yaml:"auth" toml:"auth"`
	HostKey           *SSHHostKey     `json:"host-key" yaml:"host-key" toml:"host-key"`
}

func (SSHClientConfig) ToGoSSHClientConfig

func (cc SSHClientConfig) ToGoSSHClientConfig() (*ssh.ClientConfig, error)

type SSHHostKey

type SSHHostKey struct {
	InsecureIgnore bool     `json:"insecure-ignore" yaml:"insecure-ignore" toml:"insecure-ignore"`
	KnownHosts     []string `json:"known-hosts" yaml:"known-hosts" toml:"known-hosts"`
}

type SSHServerConfig

type SSHServerConfig struct {
	SSHBaseConfig
	PublicKeyAuthAlgorithms []string    `json:"public-key-auth-algorithms" yaml:"public-key-auth-algorithms" toml:"public-key-auth-algorithms"`
	NoClientAuth            bool        `json:"no-client-auth" yaml:"no-client-auth" toml:"no-client-auth"`
	MaxAuthTries            int         `json:"max-auth-tries" yaml:"max-auth-tries" toml:"max-auth-tries"`
	ServerVersion           string      `json:"server-version" yaml:"server-version" toml:"server-version"`
	HostKeys                []SSHSigner `json:"host-keys" yaml:"host-keys" toml:"host-keys"`
}

func (SSHServerConfig) ToGoSSHServerConfig

func (sc SSHServerConfig) ToGoSSHServerConfig() (*ssh.ServerConfig, error)

type SSHSigner

type SSHSigner struct {
	PrivateKeyFile string `json:"private-key" yaml:"private-key" toml:"private-key"`
	PrivateKeyData string `json:"private-key-data" yaml:"private-key-data" toml:"private-key-data"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL