Documentation ¶
Index ¶
- Variables
- func DirectTCPIPHandler(ctx context.Context, srv *Server, conn *gossh.ServerConn, ...)
- func GetCertHostSigner(sshCA string, privk1 *ecdsa.PrivateKey) (string, gossh.Signer, error)
- func GetSSHSignclient(sshCA string) (sshca.SSHCertificateServiceClient, *grpc.ClientConn, error)
- func InitFromSecret(sshCM map[string][]byte, ns string)
- func KeysEqual(ak, bk gossh.PublicKey) bool
- func StartSSHDWithCA(ns string, sshCA string) error
- func StartSSHDWithKeys(ns string, sshCA string) error
- type Client
- type ForwardedTCPHandler
- type Pty
- type RemoteExec
- type Server
- type Signal
- type Window
Constants ¶
This section is empty.
Variables ¶
var ( // ErrEOF is the error when the terminal exits ErrEOF = errors.New("EOF") )
Functions ¶
func DirectTCPIPHandler ¶
func DirectTCPIPHandler(ctx context.Context, srv *Server, conn *gossh.ServerConn, newChan gossh.NewChannel)
DirectTCPIPHandler can be enabled by adding it to the server's ChannelHandlers under direct-tcpip.
func GetCertHostSigner ¶
func GetSSHSignclient ¶
func GetSSHSignclient(sshCA string) (sshca.SSHCertificateServiceClient, *grpc.ClientConn, error)
func InitFromSecret ¶
InitFromSecret is a helper method to init the sshd using a secret or CA address
func StartSSHDWithCA ¶
StartSSHDWithCA starts an in-process SSHD using the SSH CA. Fallback to self-signed keys if the CA is not available.
func StartSSHDWithKeys ¶
Types ¶
type Client ¶
type Client struct { SSHCa string SSHD string Namespace string User string Signer ssh.Signer RemoteKey ssh.PublicKey RemoteHostname string RemoteAddr net.Addr CAKey ssh.PublicKey CertChecker *ssh.CertChecker // contains filtered or unexported fields }
Client is a SSH client, using Istio-like certificates. By default will get a client cert, using the Istio identity, and connect to the specified SSHD.
Will also forward the HBONE ports.
func (*Client) InitSigner ¶
type ForwardedTCPHandler ¶
ForwardedTCPHandler can be enabled by creating a ForwardedTCPHandler and adding the HandleSSHRequest callback to the server's RequestHandlers under tcpip-forward and cancel-tcpip-forward.
func (*ForwardedTCPHandler) HandleSSHRequest ¶
func (h *ForwardedTCPHandler) HandleSSHRequest(ctx context.Context, srv *Server, req *gossh.Request, conn *gossh.ServerConn) (bool, []byte)
type RemoteExec ¶
type Server ¶
type Server struct { Port int Shell string AuthorizedKeys []gossh.PublicKey CertChecker *gossh.CertChecker Address string Listener net.Listener // contains filtered or unexported fields }
func NewSSHTransport ¶
func (*Server) AddAuthorized ¶
func (*Server) AddAuthorizedFile ¶
func (*Server) AddAuthorizedKeys ¶
func (*Server) HandleServerConn ¶
Handles a connection as SSH server, using a net.Conn - which might be tunneled over other transports. SSH handles multiplexing and packets.