Documentation ¶
Index ¶
- Constants
- func Conn(c *Client, cfg *ssh.ClientConfig) (err error)
- func DefaultKnownHosts() (ssh.HostKeyCallback, error)
- func Download(c *ssh.Client, src string, dest string) (err error)
- func GetSigner(prvFile string, passphrase string) (ssh.Signer, error)
- func KnownHosts(kh string) (ssh.HostKeyCallback, error)
- func Upload(c *ssh.Client, src string, dest string) (err error)
- type Auth
- type Client
Constants ¶
View Source
const ( UDP string = "udp" TCP string = "tcp" )
Variables ¶
This section is empty.
Functions ¶
func Conn ¶
func Conn(c *Client, cfg *ssh.ClientConfig) (err error)
Set new net connection to a client.
func DefaultKnownHosts ¶
func DefaultKnownHosts() (ssh.HostKeyCallback, error)
Use default known hosts files to verify host public key.
func KnownHosts ¶
func KnownHosts(kh string) (ssh.HostKeyCallback, error)
Get known hosts callback from a custom path.
Types ¶
type Auth ¶
type Auth []ssh.AuthMethod
type Client ¶
func NewConn ¶
func NewConn(user string, addr string, auth Auth, callback ssh.HostKeyCallback) (c *Client, err error)
Get new client connection.
func NewUnknown ¶
Connect to ssh and get client without cheking knownhosts. PLEASE AVOID USING THIS, UNLESS YOU KNOW WHAT ARE YOU DOING! if there a "man in the middle proxy", this can harm you! You can add the key to know hosts and use New() func instead!
func (Client) NewSession ¶
Get new ssh session from client connection See: https://pkg.go.dev/golang.org/x/crypto/ssh?tab=doc#Session
Click to show internal directories.
Click to hide internal directories.