mirror of
https://github.com/vyos/vyos-build.git
synced 2025-10-01 20:28:40 +02:00
ssh: T5841: Remove ssh-session-cleanup.service
With libpam-systemd >= 230-2, ssh-session-cleanup.service is no longer necessary because when `UsePAM yes` in `/etc/ssh/sshd_config` (which is the default), SSH sessions are cleaned up automatically when ssh-server is shutdown or the system is rebooted.
This commit is contained in:
parent
25e0cdefbe
commit
10b5c5bc93
@ -76,7 +76,6 @@ systemctl disable dpkg-db-backup.service
|
||||
systemctl disable zabbix-agent2.service
|
||||
|
||||
echo I: Enabling services
|
||||
systemctl enable ssh-session-cleanup.service
|
||||
systemctl enable vyos-hostsd.service
|
||||
systemctl enable acpid.service
|
||||
systemctl enable vyos-router.service
|
||||
|
||||
@ -1,13 +0,0 @@
|
||||
[Unit]
|
||||
Description=OpenBSD Secure Shell session cleanup
|
||||
Wants=network.target
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/bin/true
|
||||
ExecStop=/usr/lib/openssh/ssh-session-cleanup
|
||||
RemainAfterExit=yes
|
||||
Type=oneshot
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@ -1,11 +0,0 @@
|
||||
#! /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
|
||||
Loading…
x
Reference in New Issue
Block a user