diff --git a/CHANGELOG.md b/CHANGELOG.md index cbd5dfb..8d8631d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## master (unreleased) -* No entry +* Return non-null exit-code on authentication error ## v1.7.0 (2018-01-02) diff --git a/ssh.go b/ssh.go index 5076964..04d4409 100644 --- a/ssh.go +++ b/ssh.go @@ -195,6 +195,7 @@ func shellHandler(s ssh.Session) { if actx.err != nil { fmt.Fprintf(s, "error: %v\n", actx.err) + _ = s.Exit(1) return } @@ -209,6 +210,7 @@ func shellHandler(s ssh.Session) { case UserTypeShell: if err := shell(s); err != nil { fmt.Fprintf(s, "error: %v\n", err) + _ = s.Exit(1) } return case UserTypeInvite: