pssh-keepalive.diff

· erock's pastes · raw

expires: 2025-10-19

 1diff --git a/pkg/pssh/server.go b/pkg/pssh/server.go
 2index 5b1777a..ea50ff1 100644
 3--- a/pkg/pssh/server.go
 4+++ b/pkg/pssh/server.go
 5@@ -203,6 +203,14 @@ func (sc *SSHServerConn) Handle(chans <-chan ssh.NewChannel, reqs <-chan *ssh.Re
 6 				return nil
 7 			}
 8 			sc.Logger.Info("new request", "type", req.Type, "wantReply", req.WantReply, "payload", req.Payload)
 9+			switch req.Type {
10+			case "keepalive@openssh.com":
11+				sc.Logger.Info("keepalive reply")
12+				err := req.Reply(true, nil)
13+				if err != nil {
14+					sc.Logger.Error("keepalive", "err", err)
15+				}
16+			}
17 		}
18 	}
19 }