From 4722d4b7980d6fd8145e2e9f08492d951ea261d1 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 6 May 2024 03:26:58 +0200 Subject: Adding debian version 1:7.9p1-10+deb10u2. Signed-off-by: Daniel Baumann --- debian/systemd/ssh-session-cleanup | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 debian/systemd/ssh-session-cleanup (limited to 'debian/systemd/ssh-session-cleanup') 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 -- cgit v1.2.3