sftputil

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddHostKey

func AddHostKey(host, port string, sshDir string) error

AddHostKey adds the SFTP host key to the known_hosts file. It uses ssh-keyscan to fetch the key.

func GenerateKey

func GenerateKey(host string, sshDir string) ([]byte, []byte, string, error)

GenerateKey generates an Ed25519 key pair and saves it to the specified directory. Returns the private key in OpenSSH PEM format, public key in SSH format, and the full path to the private key file.

func InstallKey

func InstallKey(host, port, user, password string, pubBytes []byte) error

InstallKey connects to the SFTP server using a password and appends the public key to authorized_keys.

func VerifyConnection

func VerifyConnection(host, port, user string, privPEM []byte) error

VerifyConnection attempts to connect using the provided private key.

Types

This section is empty.

Jump to

Keyboard shortcuts

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