diff --git a/main.go b/main.go index 627f856..6436410 100644 --- a/main.go +++ b/main.go @@ -46,13 +46,13 @@ func main() { } ssh.Handle(func(s ssh.Session) { - // authorizedKey := gossh.MarshalAuthorizedKey(s.PublicKey()) io.WriteString(s, WELCOME) cmd := exec.Command("/bin/bash") ptyReq, winCh, isPty := s.Pty() if isPty { cmd.Env = append(cmd.Env, fmt.Sprintf("TERM=%s", ptyReq.Term)) + cmd.Env = append(cmd.Env, fmt.Sprintf("HOME=/root")) f, err := pty.Start(cmd) if err != nil { panic(err) @@ -67,6 +67,7 @@ func main() { }() io.Copy(s, f) // stdout cmd.Wait() + s.Exit(0) } else { io.WriteString(s, "No PTY requested.\n") s.Exit(1)