ssh

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: MIT Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	ErrSSHBannerTimeout greet.ErrorCode = "banner_timeout"
	ErrSSHInvalidBanner greet.ErrorCode = "invalid_banner"
)
View Source
const DefaultSSHPort = 22

DefaultSSHPort is the well-known port for SSH.

View Source
const ProtocolName = "ssh"

ProtocolName is the registered name for the SSH protocol.

Variables

This section is empty.

Functions

This section is empty.

Types

type SSH

type SSH struct{}

SSH implements an SSH version banner probe. It connects, reads the server's version string, and closes without sending its own banner (anonymous probe).

func New added in v1.0.3

func New() *SSH

New creates a new SSH application layer.

func (*SSH) BaseTransport added in v1.0.3

func (s *SSH) BaseTransport() greet.Transport

func (*SSH) DefaultPort

func (s *SSH) DefaultPort() int

func (*SSH) Description

func (s *SSH) Description() string

func (*SSH) Handshake added in v1.0.3

func (s *SSH) Handshake(ctx context.Context, start time.Time, conn net.Conn, host string, port int, cfg *greet.GreetConfig) (net.Conn, greet.LayerData, greet.LayerTiming, error)

Handshake reads the SSH version banner over an already-dialed conn. start is the shared timing anchor from the transport dial.

func (*SSH) Name

func (s *SSH) Name() string

type SSHResult

type SSHResult struct {
	VersionString string // e.g. "SSH-2.0-OpenSSH_8.9"
}

SSHResult holds the outcome of an SSH banner exchange.

func (*SSHResult) LayerDataName added in v1.0.3

func (r *SSHResult) LayerDataName() string

Jump to

Keyboard shortcuts

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