sshnode

package
v3.0.0-beta10 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddKnownHost

func AddKnownHost(host string, key ssh.PublicKey) error

AddKnownHost callers must care for thread safety

func AppendAuthorizedKeys

func AppendAuthorizedKeys(line []byte) error

func AuthorizedKeysFile

func AuthorizedKeysFile() (string, error)

func CreateSSHDir

func CreateSSHDir() error

func KnownHostsFile

func KnownHostsFile() (string, error)

func NewClient

func NewClient(nodename string, opts ...funcopt.O) (*ssh.Client, error)

func WithPort

func WithPort(port uint16) funcopt.O

WithPort sets the ssh port value (default is 22)

func WithPrivateKeyFiles

func WithPrivateKeyFiles(privateKeyFiles ...string) funcopt.O

WithPrivateKeyFiles specifies private key files to be added at the start of the default list of private key files.

func WithTimeout

func WithTimeout(timeout time.Duration) funcopt.O

WithTimeout sets the ssh ClientConfig.Timeout (default is 10 * time.Second)

func WithUser

func WithUser(user string) funcopt.O

WithUser sets the ssh user value (default is root)

Types

type AuthorizedKeysMap

type AuthorizedKeysMap map[string]any

func GetAuthorizedKeysMap

func GetAuthorizedKeysMap() (AuthorizedKeysMap, error)

func (AuthorizedKeysMap) Has

func (m AuthorizedKeysMap) Has(data []byte) (bool, error)

type KnownHostsMap

type KnownHostsMap map[string]any

func GetKnownHostsMap

func GetKnownHostsMap() (KnownHostsMap, error)

func (KnownHostsMap) Add

func (m KnownHostsMap) Add(host string, k ssh.PublicKey) error

func (KnownHostsMap) Has

func (m KnownHostsMap) Has(k ssh.PublicKey) (bool, error)

Jump to

Keyboard shortcuts

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