Documentation ¶
Index ¶
- type RequestSender
- type Server
- func (s *Server) AdvertiseAddr() string
- func (s *Server) Close() error
- func (s *Server) Component() string
- func (s *Server) Dial() (net.Conn, error)
- func (s *Server) EmitAuditEvent(eventType string, fields events.EventFields)
- func (s *Server) GetAccessPoint() auth.AccessPoint
- func (s *Server) GetAuditLog() events.IAuditLog
- func (s *Server) GetDataDir() string
- func (s *Server) GetInfo() services.Server
- func (s *Server) GetNamespace() string
- func (s *Server) GetPAM() (*pam.Config, error)
- func (s *Server) GetSessionServer() session.Service
- func (s *Server) ID() string
- func (s *Server) PermitUserEnvironment() bool
- func (s *Server) Serve()
- type ServerConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RequestSender ¶
type RequestSender interface { // SendRequest is used to send a out-of-band request. SendRequest(name string, wantReply bool, payload []byte) (bool, []byte, error) }
RequestSender is an interface that impliments SendRequest. It is used so server and client connections can be passed to functions to send requests.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a forwarding server. Server is used to create a single in-memory SSH server that will forward connections to a remote server. It's used along with the recording proxy to allow Teleport to record sessions with OpenSSH nodes at the proxy level.
To create a forwarding server and serve a single SSH connection on it:
serverConfig := forward.ServerConfig{ ... } remoteServer, err := forward.New(serverConfig) if err != nil { return nil, trace.Wrap(err) } go remoteServer.Serve() conn, err := remoteServer.Dial() if err != nil { return nil, trace.Wrap(err) }
func (*Server) AdvertiseAddr ¶
AdvertiseAddr is the address of the remote host this forwarding server is connected to.
func (*Server) Close ¶
Close will close all underlying connections that the forwarding server holds.
func (*Server) EmitAuditEvent ¶
func (s *Server) EmitAuditEvent(eventType string, fields events.EventFields)
EmitAuditEvent sends an event to the Audit Log.
func (*Server) GetAccessPoint ¶
func (s *Server) GetAccessPoint() auth.AccessPoint
GetAccessPoint returns an auth.AccessPoint for this cluster.
func (*Server) GetAuditLog ¶
GetAuditLog returns the Audit Log for this cluster.
func (*Server) GetDataDir ¶
GetDataDir returns server local storage
func (*Server) GetNamespace ¶
GetNamespace returns the namespace the forwarding server resides in.
func (*Server) GetPAM ¶
GetPAM returns the PAM configuration for a server. Because the forwarding server runs in-memory, it does not support PAM.
func (*Server) GetSessionServer ¶
GetSessionServer returns a session server.
func (*Server) PermitUserEnvironment ¶
PermitUserEnvironment is always false because it's up the the remote host to decide if the user environment will be read or not.
type ServerConfig ¶
type ServerConfig struct { AuthClient auth.ClientI UserAgent agent.Agent TargetConn net.Conn SrcAddr net.Addr DstAddr net.Addr HostCertificate ssh.Signer // Ciphers is a list of ciphers that the server supports. If omitted, // the defaults will be used. Ciphers []string // KEXAlgorithms is a list of key exchange (KEX) algorithms that the // server supports. If omitted, the defaults will be used. KEXAlgorithms []string // MACAlgorithms is a list of message authentication codes (MAC) that // the server supports. If omitted the defaults will be used. MACAlgorithms []string // DataDir is a local data directory used for local server storage DataDir string }
ServerConfig is the configuration needed to create an instance of a Server.
func (*ServerConfig) CheckDefaults ¶
func (s *ServerConfig) CheckDefaults() error
CheckDefaults makes sure all required parameters are passed in.