Help us shape the future of Go! Take the 2026 Go Developer Survey

sshd

package
v0.35.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2026 License: Apache-2.0, Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	User                        string
	Path                        string
	Port                        int
	AuthorizedPrincipalsCommand string

	Output safeBuffer
	// contains filtered or unexported fields
}

func Start

func Start(caPubKey sshcert.RawPublicKey) (*Server, error)

Start starts an sshd server as the current user, and returns a Server. The ssh server will be running in a temporary directory, and will process requests on a random port.

It will only process a single ssh connection before terminating.

func StartWithEpithetAuthorizedPrincipals added in v0.23.0

func StartWithEpithetAuthorizedPrincipals(caPubKey sshcert.RawPublicKey, epithetPath string, acceptAccountName bool) (*Server, error)

StartWithEpithetAuthorizedPrincipals starts an sshd whose principal lookup runs the supplied epithet binary against the server's generated domain. acceptAccountName enables the helper's bounded migration overlap.

func StartWithEpithetAuthorizedPrincipalsInDomain added in v0.24.0

func StartWithEpithetAuthorizedPrincipalsInDomain(caPubKey sshcert.RawPublicKey, epithetPath string, acceptAccountName bool, domain principal.Domain) (*Server, error)

StartWithEpithetAuthorizedPrincipalsInDomain starts an sshd in domain. An empty domain generates the ordinary isolated per-host default.

func (*Server) Close

func (s *Server) Close() error

func (*Server) Domain added in v0.24.0

func (s *Server) Domain() principal.Domain

Domain returns the authorization domain used by this fixture's principal authorization helper.

func (*Server) HostPublicKey added in v0.23.0

func (s *Server) HostPublicKey() sshcert.RawPublicKey

HostPublicKey returns the public half of the identity key used by this fixture's sshd.

func (*Server) Ssh

func (s *Server) Ssh(a *agent.Agent) (string, error)

Ssh connects to the SSH server using the provided agent (v1 API)

func (*Server) SshWithBroker added in v0.1.1

func (s *Server) SshWithBroker(b *broker.Broker) (string, error)

SshWithBroker connects to the SSH server using the broker's per-connection agent (v2 API). It computes the connection hash and uses the appropriate agent socket from the broker.

Jump to

Keyboard shortcuts

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