exec: write stderr to SSH stderr channel, not stdout

This commit is contained in:
Michael Stapelberg 2018-06-11 23:17:46 +02:00
parent 8eb60e64b7
commit ae93fa3cab

2
ssh.go
View File

@ -149,7 +149,7 @@ func (s *session) request(req *ssh.Request) error {
}
go io.Copy(s.channel, stdout)
go io.Copy(s.channel, stderr)
go io.Copy(s.channel.Stderr(), stderr)
go func() {
io.Copy(stdin, s.channel)
stdin.Close()