Skip to content

Commit 75f2002

Browse files
chore: fixed exit code
1 parent ff590f1 commit 75f2002

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

packages/pam/local/ssh-proxy.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,13 @@ func (p *SSHProxyServer) gracefulShutdown() {
269269

270270
log.Debug().Msg("SSH proxy shutdown complete")
271271

272-
os.Exit(p.sshExitCode)
272+
// Only propagate SSH exit code in exec mode (non-interactive)
273+
// For interactive sessions, always exit 0 on clean shutdown
274+
exitCode := 0
275+
if p.options.ExecCommand != "" {
276+
exitCode = p.sshExitCode
277+
}
278+
os.Exit(exitCode)
273279
})
274280
}
275281

0 commit comments

Comments
 (0)