winssh

package module
v0.0.0-...-6b19b2b Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 29 Imported by: 1

README

winssh

An addition to ssh of gliderlabs so that you can use agent forwarding with sshd on Windows

usage

look example

Documentation

Index

Constants

View Source
const (
	AgentRequestType = "auth-agent-req@openssh.com"
)
View Source
const (
	BUG = "Ж"
)
View Source
const (
	SSH_AUTH_SOCK = "SSH_AUTH_SOCK"
)

Variables

This section is empty.

Functions

func Authorized

func Authorized(key gl.PublicKey, authorized []gl.PublicKey) bool

is autorized

func Banner(ss ...string) string

func BytesToAuthorized

func BytesToAuthorized(authorized_keys []byte, old []gl.PublicKey) (authorized []gl.PublicKey)

case no files then write from embed

func CutSSH2

func CutSSH2(s string) string

Баннер без префикса SSH2

func Env

func Env(s gl.Session, shell string) (e []string)

func EtcDirs

func EtcDirs(dirs ...string) (s string)

etc

func Fatal

func Fatal(err error)

func FatalAnd

func FatalAnd(s string, cases ...bool)

func FatalOr

func FatalOr(s string, cases ...bool)

func FileToAuthorized

func FileToAuthorized(bs []byte, err error) (authorized []gl.PublicKey)

ParseAuthorizedKeys

func GenerateSigner

func GenerateSigner(pri string) (gl.Signer, error)

like gl.GenerateSigner plus write key to files

func GetHostKey

func GetHostKey(ssh string) (pri string)

get one key

func GetUserKeys

func GetUserKeys(cwd string, fns ...string) (authorized []gl.PublicKey)

get allowed keys

func GetUserKeysPaths

func GetUserKeysPaths(ssh string, fns ...string) []string

get authorized keys paths

func Home

func Home(s gl.Session) string

set Home of user

func Keepalive

func Keepalive(s gl.Session, ClientAliveInterval time.Duration, ServerAliveCountMax int)

func KeyToAuthorized

func KeyToAuthorized(key gl.PublicKey, old []gl.PublicKey) []gl.PublicKey

case no files and not embed then write from first client

func KidsDone

func KidsDone(ppid int)

func NewAgentListener

func NewAgentListener(s gl.Session) (net.Listener, error)

NewAgentListener sets up a temporary Unix socket that can be communicated to the session environment and used for forwarding connections.

func NoPTY

func NoPTY(s gl.Session)

`ssh -p 2222 a@127.0.0.1 command` `ssh -p 2222 a@127.0.0.1 -T`

func PidDone

func PidDone(pid int)

func Println

func Println(v ...any) (ok bool)

func SessionHandler

func SessionHandler(srv *gl.Server, conn *ssh.ServerConn, newChan ssh.NewChannel, ctx gl.Context)

func SessionRequestCallback

func SessionRequestCallback(s gl.Session, requestType string) bool

func SetConsoleTitle

func SetConsoleTitle(s gl.Session)

Меняю заголовок окна у клиента

func ShArgs

func ShArgs(s gl.Session) (args []string, cmdLine string)

shell

func ShellOrExec

func ShellOrExec(s gl.Session)

for shell and exec

func SubsystemHandlerAgent

func SubsystemHandlerAgent(s gl.Session)

SubsystemHandlers for agent

func SubsystemHandlerSftp

func SubsystemHandlerSftp(s gl.Session)

SubsystemHandlerSftp for sftp

func UserHomeDirs

func UserHomeDirs(dirs ...string) (s string)

Упрямый вариант

func UserName

func UserName() string

Types

This section is empty.

Directories

Path Synopsis
git clone https://github.com/abakum/winssh go mod init github.com/abakum/winssh go get github.com/gliderlabs/ssh go get github.com/pkg/sftp go get github.com/abakum/go-console go get github.com/xlab/closer go mod tidy
git clone https://github.com/abakum/winssh go mod init github.com/abakum/winssh go get github.com/gliderlabs/ssh go get github.com/pkg/sftp go get github.com/abakum/go-console go get github.com/xlab/closer go mod tidy
example
spy
spy

Jump to

Keyboard shortcuts

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