srv

package
v0.2.0-beta.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 10, 2016 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Overview

Copyright 2015 Gravitational, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2015 Gravitational, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Package srv implements SSH server that supports multiplexing tunneling, SSH connections proxying and only supports Key based auth

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DirectTCPIPReq

type DirectTCPIPReq struct {
	Host string
	Port uint32

	Orig     string
	OrigPort uint32
}

func ParseDirectTCPIPReq

func ParseDirectTCPIPReq(data []byte) (*DirectTCPIPReq, error)

type Server

type Server struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Server implements SSH server that uses configuration backend and certificate-based authentication

func New

func New(addr utils.NetAddr,
	hostname string,
	signers []ssh.Signer,
	authService auth.AccessPoint,
	dataDir string,
	advertiseIP net.IP,
	options ...ServerOption) (*Server, error)

New returns an unstarted server

func (*Server) Addr

func (s *Server) Addr() string

Addr returns server address

func (*Server) AdvertiseAddr added in v1.0.0

func (s *Server) AdvertiseAddr() string

AdvertiseAddr returns an address this server should be publicly accessible as, in "ip:host" form

func (*Server) Close

func (s *Server) Close() error

Close closes listening socket and stops accepting connections

func (*Server) EmitAuditEvent added in v1.0.0

func (s *Server) EmitAuditEvent(eventType string, fields events.EventFields)

EmitAuditEvent logs a given event to the audit log attached to the server who owns these sessions

func (*Server) HandleNewChan

func (s *Server) HandleNewChan(nc net.Conn, sconn *ssh.ServerConn, nch ssh.NewChannel)

HandleNewChan is called when new channel is opened

func (*Server) HandleRequest

func (s *Server) HandleRequest(r *ssh.Request)

HandleRequest is a callback for out of band requests

func (*Server) ID

func (s *Server) ID() string

ID returns server ID

func (*Server) Start

func (s *Server) Start() error

Start starts server

func (*Server) Wait

func (s *Server) Wait()

Wait waits until server stops

type ServerOption

type ServerOption func(s *Server) error

ServerOption is a functional option passed to the server

func SetAuditLog added in v1.0.0

func SetAuditLog(alog events.IAuditLog) ServerOption

SetAuditLog assigns an audit log interfaces to this server

func SetLabels

func SetLabels(labels map[string]string,
	cmdLabels services.CommandLabels) ServerOption

SetLabels sets dynamic and static labels that server will report to the auth servers

func SetLimiter added in v1.0.0

func SetLimiter(limiter *limiter.Limiter) ServerOption

SetLimiter sets rate and connection limiter for this server

func SetProxyMode

func SetProxyMode(tsrv reversetunnel.Server) ServerOption

SetProxyMode starts this server in SSH proxying mode

func SetSessionServer

func SetSessionServer(srv rsession.Service) ServerOption

SetSessionServer represents realtime session registry server

func SetShell

func SetShell(shell string) ServerOption

SetShell sets default shell that will be executed for interactive sessions

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL