Categorygithub.com/stephen-fox/sshutil
modulepackage
0.2.1
Repository: https://github.com/stephen-fox/sshutil.git
Documentation: pkg.go.dev

# README

sshutil

GoDoc

sshutil provides additional SSH functionality and helper code for working with 'github.com/pkg/sftp' and 'golang.org/x/crypto/ssh'.

# Packages

No description provided by the author

# Functions

AddHostKeyToKnownHosts adds a host key to the known hosts file.
AllowAndAddHostKeyCallBack permits any host and adds its public key to the known hosts file.
CurrentUserOpenSSHPrivateKeys returns the current user's OpenSSH private keys.
CurrentUserUnencryptedOpenSSHPrivateKeys returns only the current user's unencrypted OpenSSH private keys.
ExecuteCommand executes a command on a remote machine using SSH.
FindSSHPrivateKeys searches for SSH private keys, parses them, and returns the corresponding []ssh.Signer using the specified config.
GetKnownHostsFile gets the path to the SSH known hosts file.
ImitateSSHClientHostKeyCallBack returns a ssh.HostKeyCallback that imitates the standard SSH command line client's behavior of prompting the user to verify an unknown public key, as well as rejecting mismatched public keys.
IsPathSSHPrivateKey returns a non-nil ssh.Signer, true, and a nil error if the specified file is an SSH private key.
IsSSHHostKnown determines if an SSH server is known by the client according to the specified known hosts file contents.
OnlyKnownHostKeyCallBack only permits known hosts when connecting to a SSH server.
ParseSSHPrivateKey wraps IsPathSSHPrivateKey.
ParseSSHPrivateKeyFromConfigDirSlice looks up the current user's SSH directory and prepends it to the specified file path.
ParseSSHPrivateKeyIntoSlice wraps ParseSSHPrivateKey, returning a slice of ssh.Signer containing only one key.
UploadFileUsingScp uploads a file using SCP (Secure Copy Protocol).
UploadFileUsingSftp uploads a file using SFTP (SSH File Transfer Protocol).

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

No description provided by the author
No description provided by the author
FindSSHPrivateKeysConfig configures the FindSSHPrivateKeys function.
No description provided by the author
No description provided by the author
SSHPrivateKeyConfig configures an SSH private key parsing function.
No description provided by the author
No description provided by the author

# Type aliases

GetPrivateKeyPasswordFunc returns a password for the current private key.