summaryrefslogtreecommitdiff
path: root/debian/systemd
diff options
context:
space:
mode:
Diffstat (limited to 'debian/systemd')
-rw-r--r--debian/systemd/ssh-agent.override1
-rw-r--r--debian/systemd/ssh-agent.service8
-rwxr-xr-xdebian/systemd/ssh-session-cleanup11
-rw-r--r--debian/systemd/ssh-session-cleanup.service13
-rw-r--r--debian/systemd/ssh.service17
-rw-r--r--debian/systemd/ssh.socket12
-rw-r--r--debian/systemd/ssh@.service8
-rw-r--r--debian/systemd/sshd.conf1
8 files changed, 71 insertions, 0 deletions
diff --git a/debian/systemd/ssh-agent.override b/debian/systemd/ssh-agent.override
new file mode 100644
index 000000000..2905494b6
--- /dev/null
+++ b/debian/systemd/ssh-agent.override
@@ -0,0 +1 @@
manual
diff --git a/debian/systemd/ssh-agent.service b/debian/systemd/ssh-agent.service
new file mode 100644
index 000000000..2297f8f75
--- /dev/null
+++ b/debian/systemd/ssh-agent.service
@@ -0,0 +1,8 @@
1[Unit]
2Description=OpenSSH Agent
3Before=graphical-session-pre.target
4ConditionPathExists=/etc/X11/Xsession.options
5
6[Service]
7ExecStart=/usr/lib/openssh/agent-launch start
8ExecStopPost=/usr/lib/openssh/agent-launch stop
diff --git a/debian/systemd/ssh-session-cleanup b/debian/systemd/ssh-session-cleanup
new file mode 100755
index 000000000..f283cc967
--- /dev/null
+++ b/debian/systemd/ssh-session-cleanup
@@ -0,0 +1,11 @@
1#! /bin/sh
2
3ssh_session_pattern='sshd: \S.*@pts/[0-9]+'
4
5IFS="$IFS@"
6pgrep -a -f "$ssh_session_pattern" | while read pid daemon user pty; do
7 echo "Found ${daemon%:} session $pid on $pty; sending SIGTERM"
8 kill "$pid" || true
9done
10
11exit 0
diff --git a/debian/systemd/ssh-session-cleanup.service b/debian/systemd/ssh-session-cleanup.service
new file mode 100644
index 000000000..b86727227
--- /dev/null
+++ b/debian/systemd/ssh-session-cleanup.service
@@ -0,0 +1,13 @@
1[Unit]
2Description=OpenBSD Secure Shell session cleanup
3Wants=network.target
4After=network.target
5
6[Service]
7ExecStart=/bin/true
8ExecStop=/usr/lib/openssh/ssh-session-cleanup
9RemainAfterExit=yes
10Type=oneshot
11
12[Install]
13WantedBy=multi-user.target
diff --git a/debian/systemd/ssh.service b/debian/systemd/ssh.service
new file mode 100644
index 000000000..3df8c6426
--- /dev/null
+++ b/debian/systemd/ssh.service
@@ -0,0 +1,17 @@
1[Unit]
2Description=OpenBSD Secure Shell server
3After=network.target auditd.service
4ConditionPathExists=!/etc/ssh/sshd_not_to_be_run
5
6[Service]
7EnvironmentFile=-/etc/default/ssh
8ExecStart=/usr/sbin/sshd -D $SSHD_OPTS
9ExecReload=/bin/kill -HUP $MAINPID
10KillMode=process
11Restart=on-failure
12RestartPreventExitStatus=255
13Type=notify
14
15[Install]
16WantedBy=multi-user.target
17Alias=sshd.service
diff --git a/debian/systemd/ssh.socket b/debian/systemd/ssh.socket
new file mode 100644
index 000000000..5a766dcab
--- /dev/null
+++ b/debian/systemd/ssh.socket
@@ -0,0 +1,12 @@
1[Unit]
2Description=OpenBSD Secure Shell server socket
3Before=ssh.service
4Conflicts=ssh.service
5ConditionPathExists=!/etc/ssh/sshd_not_to_be_run
6
7[Socket]
8ListenStream=22
9Accept=yes
10
11[Install]
12WantedBy=sockets.target
diff --git a/debian/systemd/ssh@.service b/debian/systemd/ssh@.service
new file mode 100644
index 000000000..4b0801dbc
--- /dev/null
+++ b/debian/systemd/ssh@.service
@@ -0,0 +1,8 @@
1[Unit]
2Description=OpenBSD Secure Shell server per-connection daemon
3After=auditd.service
4
5[Service]
6EnvironmentFile=-/etc/default/ssh
7ExecStart=-/usr/sbin/sshd -i $SSHD_OPTS
8StandardInput=socket
diff --git a/debian/systemd/sshd.conf b/debian/systemd/sshd.conf
new file mode 100644
index 000000000..ab7302189
--- /dev/null
+++ b/debian/systemd/sshd.conf
@@ -0,0 +1 @@
d /var/run/sshd 0755 root root