diff --git a/pkg/ssh/ssh.go b/pkg/ssh/ssh.go index 0a501a5a9..4cfde71c2 100644 --- a/pkg/ssh/ssh.go +++ b/pkg/ssh/ssh.go @@ -5,6 +5,7 @@ import ( "fmt" "net" "os" + "runtime" "strconv" "time" @@ -85,14 +86,19 @@ func NewSSHServer(ctx context.Context) (*SSHServer, error) { ), } - s.srv, err = wish.NewServer( + opts := []ssh.Option{ ssh.PublicKeyAuth(s.PublicKeyHandler), ssh.KeyboardInteractiveAuth(s.KeyboardInteractiveHandler), - ssh.AllocatePty(), wish.WithAddress(cfg.SSH.ListenAddr), wish.WithHostKeyPath(cfg.SSH.KeyPath), wish.WithMiddleware(mw...), - ) + } + if runtime.GOOS == "windows" { + opts = append(opts, ssh.EmulatePty()) + } else { + opts = append(opts, ssh.AllocatePty()) + } + s.srv, err = wish.NewServer(opts...) if err != nil { return nil, err }