modulepackage
0.0.0-20200309233458-3265b99a8c98
Repository: https://github.com/gobs/sssh.git
Documentation: pkg.go.dev
# README
sssh (simple ssh)
A wrapper to golang.org/x/crypto/ssh to simplify session creation
This package provides a wrapper that simplifies creating an ssh session.
The package supports creating a session, authenticated via username/password or username/private key, with optional socks5 proxy.
This is roughly equivalent to an ssh connection with the following options:
Host hostname
ProxyCommand /usr/bin/nc -x proxyserver:port %h %p
User username
IdentityFile privatekey-file
To use, create a new session:
session, err := sssh.NewSession("somehost:22",
sssh.User(username),
sssh.Password(password))
if err != nil {
...
}
defer session.Close()
Then use one of the methods in ssh.Session (https://godoc.org/golang.org/x/crypto/ssh#Session):
if err = session.Run("ls -l"); err != nil {
...
}
Additional documentation is available at https://godoc.org/github.com/gobs/sssh.
A working example is available in the cmd/sssh subfolder.
# Packages
No description provided by the author
# Functions
Banner sets the banner callback, called when the remote host sends the banner.
No description provided by the author
No description provided by the author
JumpProxy configures the session to jump through one proxy server.
KeyboardInteractive sets the authentication mode to keyboar/interactive.
NewClient creates a new ssh client/connection to host (host:port) with the specified options.
NewSession creates a new ssh session/connection to host (host:port) with the specified options.
Password sets the user password for authentication.
PrivateKey sets the private key for authentication.
PrivateKeyFile sets the private key file for authentication.
No description provided by the author
SocksProxy sets the (socks5) proxy address (host:port).
Timeout sets the connection timeout.
User sets the user name for authentication.
# Variables
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Type aliases
ConnectOption is the common type for NewSession options.
type KeyboardInteractiveChallenge func(user, instruction string, questions []string, echos []bool) (answers []string, err error).