Created
April 12, 2020 15:24
-
-
Save CharlyCst/1ae0822565902206bbb44b2f00305eb0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"github.com/gliderlabs/ssh" | |
"fmt" | |
"io" | |
"log" | |
lb "gosb" | |
) | |
func init() { | |
lb.Initialize(lb.MPK_BACKEND) | |
} | |
func main() { | |
handler := sandbox["", ""](s ssh.Session) { | |
// handler := func(s ssh.Session) { | |
io.WriteString(s, fmt.Sprintf("Hello %s\n", s.User())) | |
} | |
ssh.Handle(handler) | |
log.Println("starting ssh server on port 2222...") | |
log.Fatal(ssh.ListenAndServe(":2222", nil)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment