sssh

package module
v0.0.0-...-a9d104c Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2023 License: MIT Imports: 10 Imported by: 0

README

sssh

golang super ssh package

查看最近SSH登陆记录

tail -100 /var/log/secure

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*ssh.Client
}

func New

func New(conf *ClientConfig) (*Client, error)

func NewClient

func NewClient(addr string) (*Client, error)

func (*Client) NewSession

func (c *Client) NewSession() (*Session, error)

type ClientConfig

type ClientConfig struct {
	Addr       string
	User       string
	Passwrod   string
	PrivateKey []byte
	// contains filtered or unexported fields
}

type Read

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

func NewRead

func NewRead() *Read

func (*Read) Close

func (r *Read) Close()

func (*Read) Read

func (r *Read) Read(p []byte) (n int, err error)

func (*Read) Send

func (r *Read) Send(command string)

type Resp

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

func (*Resp) Int

func (r *Resp) Int() int

func (*Resp) String

func (r *Resp) String() string

type Session

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

func NewSession

func NewSession(addr string) (*Session, error)

func (*Session) Close

func (s *Session) Close() error

func (*Session) CloseClient

func (s *Session) CloseClient() error

func (*Session) Send

func (s *Session) Send(command string) *Resp

type Write

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

func NewWrite

func NewWrite() *Write

func (*Write) Write

func (w *Write) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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