sshw

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultCiphers = []string{
		"aes128-ctr",
		"aes192-ctr",
		"aes256-ctr",
		"aes128-gcm@openssh.com",
		"chacha20-poly1305@openssh.com",
		"arcfour256",
		"arcfour128",
		"arcfour",
		"aes128-cbc",
		"3des-cbc",
		"blowfish-cbc",
		"cast128-cbc",
		"aes192-cbc",
		"aes256-cbc",
	}
)

Functions

func FlushStdin

func FlushStdin()

FlushStdin clears any pending input from stdin

func LoadConfig

func LoadConfig(path string) error

func LoadConfigBytes

func LoadConfigBytes(names ...string) ([]byte, error)

func LoadSshConfig

func LoadSshConfig() error

func NewSFTPClient

func NewSFTPClient(sshClient *ssh.Client) (*sftp.Client, error)

NewSFTPClient creates an SFTP client from an SSH client with performance optimizations

func SetLogger

func SetLogger(logger Logger)

Types

type CallbackShell

type CallbackShell struct {
	Cmd   string        `yaml:"cmd"`
	Delay time.Duration `yaml:"delay"`
}

type Client

type Client interface {
	Login()
	LoginSFTP()
}

func NewClient

func NewClient(node *Node) Client

type ConnType

type ConnType int

ConnType represents the connection type

const (
	ConnTypeSSH ConnType = iota
	ConnTypeSFTP
)

func (ConnType) Description

func (c ConnType) Description() string

func (ConnType) String

func (c ConnType) String() string

type Logger

type Logger interface {
	Info(args ...interface{})
	Infof(format string, args ...interface{})
	Error(args ...interface{})
	Errorf(format string, args ...interface{})
}

func GetLogger

func GetLogger() Logger

type Node

type Node struct {
	Name           string           `yaml:"name"`
	Alias          string           `yaml:"alias"`
	Host           string           `yaml:"host"`
	User           string           `yaml:"user"`
	Port           int              `yaml:"port"`
	KeyPath        string           `yaml:"keypath"`
	Passphrase     string           `yaml:"passphrase"`
	Password       string           `yaml:"password"`
	CallbackShells []*CallbackShell `yaml:"callback-shells"`
	Children       []*Node          `yaml:"children"`
	Jump           []*Node          `yaml:"jump"`
}

func GetConfig

func GetConfig() []*Node

func (*Node) String

func (n *Node) String() string

type SFTPShell

type SFTPShell struct {
	// contains filtered or unexported fields
}

SFTPShell manages the interactive SFTP session

func NewSFTPShell

func NewSFTPShell(client *sftp.Client, node *Node) *SFTPShell

NewSFTPShell creates a new SFTP shell instance

func (*SFTPShell) Run

func (s *SFTPShell) Run()

Run starts the interactive SFTP shell

Jump to

Keyboard shortcuts

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