MCPcopy Create free account
hub / github.com/Fahrj/reverse-ssh / createPasswordHandler

Function createPasswordHandler

core.go:79–89  ·  view source on GitHub ↗
(localPassword string)

Source from the content-addressed store, hash-verified

77}
78
79func createPasswordHandler(localPassword string) ssh.PasswordHandler {
80 return func(ctx ssh.Context, pass string) bool {
81 passed := pass == localPassword
82 if passed {
83 log.Printf("Successful authentication with password from %s@%s", ctx.User(), ctx.RemoteAddr().String())
84 } else {
85 log.Printf("Invalid password from %s@%s", ctx.User(), ctx.RemoteAddr().String())
86 }
87 return passed
88 }
89}
90
91func createPublicKeyHandler(authorizedKey string) ssh.PublicKeyHandler {
92 if authorizedKey == "" {

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected