Documentation ¶
Index ¶
- func Error(s ssh.Session, v ...interface{})
- func Errorf(s ssh.Session, f string, v ...interface{})
- func Errorln(s ssh.Session, v ...interface{})
- func Fatal(s ssh.Session, v ...interface{})
- func Fatalf(s ssh.Session, f string, v ...interface{})
- func Fatalln(s ssh.Session, v ...interface{})
- func NewServer(ops ...ssh.Option) (*ssh.Server, error)
- func Print(s ssh.Session, v ...interface{})
- func Printf(s ssh.Session, f string, v ...interface{})
- func Println(s ssh.Session, v ...interface{})
- func WithAddress(addr string) ssh.Option
- func WithAuthorizedKeys(path string) ssh.Option
- func WithHostKeyPEM(pem []byte) ssh.Option
- func WithHostKeyPath(path string) ssh.Option
- func WithIdleTimeout(d time.Duration) ssh.Option
- func WithKeyboardInteractiveAuth(h ssh.KeyboardInteractiveHandler) ssh.Option
- func WithMaxTimeout(d time.Duration) ssh.Option
- func WithMiddleware(mw ...Middleware) ssh.Option
- func WithPasswordAuth(p ssh.PasswordHandler) ssh.Option
- func WithPublicKeyAuth(h ssh.PublicKeyHandler) ssh.Option
- func WithTrustedUserCAKeys(path string) ssh.Option
- func WithVersion(version string) ssh.Option
- func WriteString(s ssh.Session, v string) (int, error)
- type Middleware
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Errorf ¶ added in v0.5.0
Errorf formats according to the given format and prints to the session's STDERR.
func Errorln ¶ added in v0.5.0
Errorf formats according to the default format and prints to the session's STDERR.
func Fatalf ¶ added in v0.5.0
Fatalf formats according to the given format, prints to the session's STDERR followed by an exit 1.
Notice that this might cause formatting issues if you don't add a \r\n in the end of your string.
func Fatalln ¶ added in v0.5.0
Fatalln formats according to the default format, prints to the session's STDERR, followed by a new line and an exit 1.
func NewServer ¶
NewServer is returns a default SSH server with the provided Middleware. A new SSH key pair of type ed25519 will be created if one does not exist. By default this server will accept all incoming connections, password and public key.
func Printf ¶ added in v0.5.0
Printf formats according to the given format and writes to the session's STDOUT.
func Println ¶ added in v0.5.0
Println formats according to the default format and writes to the session's STDOUT.
func WithAddress ¶
WithAddress returns an ssh.Option that sets the address to listen on.
func WithAuthorizedKeys ¶ added in v0.2.0
WithAuthorizedKeys allows to use a SSH authorized_keys file to allowlist users.
func WithHostKeyPEM ¶
WithHostKeyPEM returns an ssh.Option that sets the host key from a PEM block.
func WithHostKeyPath ¶
WithHostKeyFile returns an ssh.Option that sets the path to the private.
func WithIdleTimeout ¶ added in v0.1.2
WithIdleTimeout returns an ssh.Option that sets the connection's idle timeout.
func WithKeyboardInteractiveAuth ¶ added in v0.6.0
func WithKeyboardInteractiveAuth(h ssh.KeyboardInteractiveHandler) ssh.Option
WithKeyboardInteractiveAuth returns an ssh.Option that sets the keyboard interactive auth handler.
func WithMaxTimeout ¶ added in v0.1.2
WithMaxTimeout returns an ssh.Option that sets the connection's absolute timeout.
func WithMiddleware ¶
func WithMiddleware(mw ...Middleware) ssh.Option
WithMiddleware composes the provided Middleware and return a ssh.Option. This useful if you manually create an ssh.Server and want to set the Server.Handler.
Notice that middlewares are composed from first to last, which means the last one is executed first.
func WithPasswordAuth ¶
func WithPasswordAuth(p ssh.PasswordHandler) ssh.Option
WithPasswordAuth returns an ssh.Option that sets the password auth handler.
func WithPublicKeyAuth ¶
func WithPublicKeyAuth(h ssh.PublicKeyHandler) ssh.Option
WithPublicKeyAuth returns an ssh.Option that sets the public key auth handler.
func WithTrustedUserCAKeys ¶ added in v0.4.0
WithTrustedUserCAKeys authorize certificates that are signed with the given Certificate Authority public key, and are valid. Analogous to the TrustedUserCAKeys OpenSSH option.
func WithVersion ¶
WithVersion returns an ssh.Option that sets the server version.
Types ¶
Directories ¶
Path | Synopsis |
---|---|
Package accesscontrol provides a middleware that allows you to restrict the commands the user can execute.
|
Package accesscontrol provides a middleware that allows you to restrict the commands the user can execute. |
Package activeterm provides a middleware to block inactive PTYs.
|
Package activeterm provides a middleware to block inactive PTYs. |
Package bubbletea provides middleware for serving bubbletea apps over SSH.
|
Package bubbletea provides middleware for serving bubbletea apps over SSH. |
Package ratelimiter provides basic rate limiting functionality as a with middeware.
|
Package ratelimiter provides basic rate limiting functionality as a with middeware. |
Package scp provides a SCP middleware for wish.
|
Package scp provides a SCP middleware for wish. |
Package testsession provides utilities to test SSH sessions.
|
Package testsession provides utilities to test SSH sessions. |