feat: add headless mode support for SSH -N connections
- use s.lifecycle.GetConnection().Wait() to block until SSH connection closes - Prevent premature session closure in headless mode In headless mode (ssh -N), there's no channel interaction to block on, so the session would immediately return and close. Now blocking on conn.Wait() keeps the session alive until the client disconnects.
This commit is contained in:
@@ -90,7 +90,6 @@ func (s *Server) handleConnection(conn net.Conn) {
|
||||
user = u
|
||||
cancel()
|
||||
}
|
||||
|
||||
log.Println("SSH connection established:", sshConn.User())
|
||||
sshSession := session.New(sshConn, forwardingReqs, chans, s.sessionRegistry, user)
|
||||
err = sshSession.Start()
|
||||
|
||||
Reference in New Issue
Block a user