|
|
@ -1,4 +1,5 @@
|
|
|
|
//+build !windows
|
|
|
|
//go:build !windows
|
|
|
|
|
|
|
|
// +build !windows
|
|
|
|
|
|
|
|
|
|
|
|
package ssh
|
|
|
|
package ssh
|
|
|
|
|
|
|
|
|
|
|
@ -196,6 +197,9 @@ func (s *Server) ListenAndServe() error {
|
|
|
|
|
|
|
|
|
|
|
|
cmd := exec.CommandContext(cmdCtx, s.executableBinary, flags...)
|
|
|
|
cmd := exec.CommandContext(cmdCtx, s.executableBinary, flags...)
|
|
|
|
cmd.Env = append(sshSession.Environ(), fmt.Sprintf("TERM=%s", ptyReq.Term))
|
|
|
|
cmd.Env = append(sshSession.Environ(), fmt.Sprintf("TERM=%s", ptyReq.Term))
|
|
|
|
|
|
|
|
if proxy, ok := os.LookupEnv("HTTPS_PROXY"); ok {
|
|
|
|
|
|
|
|
cmd.Env = append(cmd.Env, fmt.Sprintf("HTTPS_PROXY=%s", proxy))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
f, err := pty.Start(cmd)
|
|
|
|
f, err := pty.Start(cmd)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
@ -238,7 +242,7 @@ func (s *Server) ListenAndServe() error {
|
|
|
|
|
|
|
|
|
|
|
|
err := s.sshServer.SetOption(ssh.HostKeyFile(s.hostKeyFile))
|
|
|
|
err := s.sshServer.SetOption(ssh.HostKeyFile(s.hostKeyFile))
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
return fmt.Errorf("error setting HostKeyFile: %s: %v", s.hostKeyFile, err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return s.sshServer.ListenAndServe()
|
|
|
|
return s.sshServer.ListenAndServe()
|
|
|
|