ssh

package
v0.7.5 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2025 License: MIT Imports: 9 Imported by: 0 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 (
	TnetSSHTunnelRequest = "tnet-tunnel" // extended request type for ssh tunnel
)

Variables

View Source
var (
	ErrSessionDead = errors.New("session is dead")
)

Functions

func NewClientConn

func NewClientConn(session *Session) net.Conn

func NewConn

func NewConn(conn net.Conn, channel ssh.Channel) net.Conn

func ParseAuthorizedKeysFile

func ParseAuthorizedKeysFile(name string) (map[string]bool, error)

ParseSSHAuthorizedKeysFile parses ssh authorized keys file.

Types

type ClientConn

type ClientConn struct {
	net.Conn
	// contains filtered or unexported fields
}

a dummy ssh client conn used by client connector

func (*ClientConn) Client

func (c *ClientConn) Client() *ssh.Client

type PasswordCallbackFunc

type PasswordCallbackFunc func(conn ssh.ConnMetadata, password []byte) (*ssh.Permissions, error)

PasswordCallbackFunc is a callback function used by SSH server. It authenticates user using a password.

func PasswordCallback

func PasswordCallback(au auth.Authenticator) PasswordCallbackFunc

type PublicKeyCallbackFunc

type PublicKeyCallbackFunc func(c ssh.ConnMetadata, pubKey ssh.PublicKey) (*ssh.Permissions, error)

PublicKeyCallbackFunc is a callback function used by SSH server. It offers a public key for authentication.

func PublicKeyCallback

func PublicKeyCallback(keys map[string]bool) PublicKeyCallbackFunc

type Session

type Session struct {
	net.Conn
	// contains filtered or unexported fields
}

func NewSession

func NewSession(c net.Conn, client *ssh.Client, log logger.Logger) *Session

func (*Session) IsClosed

func (s *Session) IsClosed() bool

func (*Session) Keepalive

func (s *Session) Keepalive(interval, timeout time.Duration, retries int)

func (*Session) OpenChannel

func (s *Session) OpenChannel(name string) (ssh.Channel, <-chan *ssh.Request, error)

func (*Session) Wait

func (s *Session) Wait() error

func (*Session) WaitClose

func (s *Session) WaitClose()

Jump to

Keyboard shortcuts

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