sshd

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuditLogArchiver

func AuditLogArchiver()

audit操作日志归档定时任务 每天归档一次压缩到tar.gz;默认保留3个月

func CheckPermission

func CheckPermission(argsWithServer string, user User, inputAction Action, matchPolicies []Policy) error

argsWithServer 是 root@10.9.x.x:/data/xx.zip 这一串组合字符,方法内会解析

func CopyID

func CopyID(username, host string, port int, passwd, pubKeyFile string) ([]byte, error)

CopyID CopyID

func ErrorInfo

func ErrorInfo(err error, sess *ssh.Session)

ErrorInfo ErrorInfo

func ExecuteSCP

func ExecuteSCP(args []string, clientSess *ssh.Session) error

ExecuteSCP ExecuteSCP

func GenKey

func GenKey(keyFilePath string) (string, string, error)

GenKey gen ssh private and public key

func GetClientByPasswd

func GetClientByPasswd(username, host string, port int, passwd string) (*sshclient.Client, error)

GetClientByPasswd GetClientByPasswd

func Info

func Info(msg string, sess *ssh.Session)

Info Info

func NewAuditLog

func NewAuditLog(user, host string) (*os.File, error)

new audit log

func NewSSHClient

func NewSSHClient(server Server, sshUser SSHUser) (*gossh.Client, *gossh.Client, error)

NewSSHClient NewSSHClient proxy client 返回主要是为了外部 close 用。

func NewTerminal

func NewTerminal(server Server, sshUser SSHUser, sess *ssh.Session) error

NewTerminal NewTerminal

func ParseRawCommand

func ParseRawCommand(command string) (string, []string, error)

ParseRawCommand ParseRawCommand

func ProxyClient

func ProxyClient(instance Server, proxy CreateProxyRequest, sshUser SSHUser) (*gossh.Client, *gossh.Client, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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