diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2017-06-21 12:18:30 +0300 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2017-06-21 12:18:30 +0300 |
commit | 31684bbc19b57842dfb8285f69ab3d19f9d0f0b5 (patch) | |
tree | 9fdea5fc4fe6929b92492c6da7929b742ce260d8 /debian/systemd/ssh-session-cleanup | |
download | openssh-debian.tar.gz |
Imported openssh 1:7.4p1-10debian/7.4p1-10debian
Diffstat (limited to 'debian/systemd/ssh-session-cleanup')
-rwxr-xr-x | debian/systemd/ssh-session-cleanup | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/debian/systemd/ssh-session-cleanup b/debian/systemd/ssh-session-cleanup new file mode 100755 index 0000000..f283cc9 --- /dev/null +++ b/debian/systemd/ssh-session-cleanup @@ -0,0 +1,11 @@ +#! /bin/sh + +ssh_session_pattern='sshd: \S.*@pts/[0-9]+' + +IFS="$IFS@" +pgrep -a -f "$ssh_session_pattern" | while read pid daemon user pty; do + echo "Found ${daemon%:} session $pid on $pty; sending SIGTERM" + kill "$pid" || true +done + +exit 0 |