when enabling SLACK_FATAL_ERRORS, the user should be logged out when the slack notification fails. However, this does not happen when using sshrcSLACK_HOOK method.
For this to be effective, replacing exit 1 with kill -TERM $PPID makes this actually die and the ssh connection to close when the SLACK_FATAL_ERRORS occur.
Found a bug? Maybe our Slack Community can help.
Describe the Bug
when enabling
SLACK_FATAL_ERRORS
, the user should be logged out when the slack notification fails. However, this does not happen when usingsshrc
SLACK_HOOK
method.The reason is that
exit 1
in https://github.com/cloudposse/bastion/blob/master/rootfs/etc/ssh/sshrc does not do anything. The ssh command runs that and happily goes into the shell after the error exit code.For this to be effective, replacing
exit 1
withkill -TERM $PPID
makes this actually die and the ssh connection to close when the SLACK_FATAL_ERRORS occur.