sshw

package module
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2022 License: MIT Imports: 22 Imported by: 0

README

sshw

仅添加支持google authenticator令牌

正版连接 https://github.com/yinheli/sshw

install

use go install

go install github.com/Ubbo-Sathla/sshw/cmd/sshw@v1.1.1

config example

- { name: dev server fully configured, user: appuser, host: 192.168.8.35, port: 22, password: 123456 ,mfa: "otpauth://totp/Ubbo-Sathla?algorithm=SHA1&digits=6&issuer=13123&period=30&secret=123456" }

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 GeneratePassCode added in v1.1.1

func GeneratePassCode(mfa string) string

func LoadConfig

func LoadConfig() error

func LoadConfigBytes added in v1.1.1

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

func LoadSshConfig added in v1.1.1

func LoadSshConfig() error

func SetLogger

func SetLogger(logger Logger)

Types

type CallbackShell added in v1.1.1

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

type Client added in v1.0.3

type Client interface {
	Login()
}

func NewClient added in v1.0.3

func NewClient(node *Node) Client

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"`
	Mfa            string           `yaml:"mfa"`
	CallbackShells []*CallbackShell `yaml:"callback-shells"`
	Children       []*Node          `yaml:"children"`
	Jump           []*Node          `yaml:"jump"`
}

func GetConfig

func GetConfig() []*Node

func (*Node) RegexpMfa added in v1.1.1

func (n *Node) RegexpMfa(q string) bool

func (*Node) String

func (n *Node) String() string

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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