Documentation
¶
Index ¶
- func AppendKnownHost(path, host, authorizedKey string) error
- func Dial(ctx context.Context, c *Client) (*xssh.Client, error)
- func EnsureKnownHostsFile(path string) error
- func GenerateEd25519Keypair(privateKeyPath string) (publicAuthorized string, err error)
- func LoadKnownHostsCallback(path string) (xssh.HostKeyCallback, error)
- func LoadPrivateKeySigner(privateKeyPath string) (xssh.Signer, error)
- func MarshalAuthorized(signer xssh.Signer) []byte
- func PullFile(ctx context.Context, client *xssh.Client, remotePath, localPath string) error
- func PushFile(ctx context.Context, client *xssh.Client, localPath, remotePath string) error
- type Client
- type Dialer
- type NetDialer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendKnownHost ¶
AppendKnownHost appends a known_hosts entry for host using the given authorized key text.
func Dial ¶
Dial establishes an SSH connection using the provided client configuration. The caller is responsible for closing the returned client.
func EnsureKnownHostsFile ¶
EnsureKnownHostsFile makes sure the directory exists and the file is created.
func GenerateEd25519Keypair ¶
GenerateEd25519Keypair creates an ed25519 keypair and writes it to disk. The private key is written in PEM format without a passphrase.
func LoadKnownHostsCallback ¶
func LoadKnownHostsCallback(path string) (xssh.HostKeyCallback, error)
LoadKnownHostsCallback returns a strict host key callback using the given file.
func LoadPrivateKeySigner ¶
LoadPrivateKeySigner reads an OpenSSH/PEM private key file and returns an ssh.Signer.
func MarshalAuthorized ¶
MarshalAuthorized returns authorized_keys text for given signer public key.