Skip to content

Instantly share code, notes, and snippets.

@CharlyCst
Created April 12, 2020 15:24
Show Gist options
  • Save CharlyCst/1ae0822565902206bbb44b2f00305eb0 to your computer and use it in GitHub Desktop.
Save CharlyCst/1ae0822565902206bbb44b2f00305eb0 to your computer and use it in GitHub Desktop.
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