Documentation ¶
Index ¶
- func AddKnownHost(host string, remote net.Addr, key ssh.PublicKey, knownFile string) (err error)
- func CheckKnownHost(host string, remote net.Addr, key ssh.PublicKey, knownFile string) (found bool, err error)
- func DefaultKnownHosts() (ssh.HostKeyCallback, error)
- func DefaultKnownHostsPath() (string, error)
- func GetSigner(prvFile string, passphrase string) (ssh.Signer, error)
- func HasAgent() bool
- func KnownHosts(file string) (ssh.HostKeyCallback, error)
- type Auth
- type Client
- func (c Client) CleanRemote(remotePath string) (err error)
- func (c Client) Close() error
- func (c Client) Download(ctx context.Context, remotePath, localPath string) (err error)
- func (c Client) NewSftp(opts ...sftp.ClientOption) (*sftp.Client, error)
- func (c Client) Run(cmd string) ([]byte, error)
- func (c Client) Upload(localPath string, remotePath string) (err error)
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddKnownHost ¶
AddKnownHost add a a host to known hosts file.
func CheckKnownHost ¶
func CheckKnownHost(host string, remote net.Addr, key ssh.PublicKey, knownFile string) (found bool, err error)
CheckKnownHost checks is host in known hosts file.
func DefaultKnownHosts ¶
func DefaultKnownHosts() (ssh.HostKeyCallback, error)
DefaultKnownHosts returns host key callback from default known hosts path, and error if any.
func DefaultKnownHostsPath ¶
DefaultKnownHostsPath returns default user knows hosts file.
func KnownHosts ¶
func KnownHosts(file string) (ssh.HostKeyCallback, error)
KnownHosts returns host key callback from a custom known hosts path.
Types ¶
type Auth ¶
type Auth []ssh.AuthMethod
Auth represents ssh auth methods.
type Client ¶
Client represents ssh client
func (Client) CleanRemote ¶
CleanRemote Deleting file on the server
Click to show internal directories.
Click to hide internal directories.