summaryrefslogtreecommitdiffstats
path: root/projectroot
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2020-08-03 10:28:17 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2020-08-07 18:38:30 +0200
commitfa741c1869f9a15ff168b69f61d0e02f414c69bb (patch)
tree4e2a54ed5a1874da2ac472f8ec7368f48b242a5c /projectroot
parent1af6cba48cdd706305ac2ea7547222b9a22fdfa7 (diff)
downloadptxdist-fa741c1869f9a15ff168b69f61d0e02f414c69bb.tar.gz
ptxdist-fa741c1869f9a15ff168b69f61d0e02f414c69bb.tar.xz
openssh: allow early ssh connections
By using DefaultDependencies=no the system can accept ssh connections earlier. This makes it possible to debug problems during startup. This means that tmpfiles.d cannot be used to create the privilege separation directory. So create it as RuntimeDirectory instead. As a side effect, this 'fixes' problems with nfsroot: tmpfiles.d refuses to create /run/sshd if / is not owned by root. This is not checked for RuntimeDirectory= so creating /run/sshd works here. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'projectroot')
-rw-r--r--projectroot/usr/lib/systemd/system/sshd@.service5
-rw-r--r--projectroot/usr/lib/tmpfiles.d/ssh.conf1
2 files changed, 4 insertions, 2 deletions
diff --git a/projectroot/usr/lib/systemd/system/sshd@.service b/projectroot/usr/lib/systemd/system/sshd@.service
index a96f28680..3814e9f7b 100644
--- a/projectroot/usr/lib/systemd/system/sshd@.service
+++ b/projectroot/usr/lib/systemd/system/sshd@.service
@@ -1,8 +1,11 @@
[Unit]
Description=SSH Per-Connection Server
-After=syslog.target
+DefaultDependencies=no
[Service]
ExecStart=/usr/sbin/sshd -i
SuccessExitStatus=0 255
StandardInput=socket
+RuntimeDirectory=sshd
+RuntimeDirectoryPreserve=yes
+RuntimeDirectoryMode=0700
diff --git a/projectroot/usr/lib/tmpfiles.d/ssh.conf b/projectroot/usr/lib/tmpfiles.d/ssh.conf
deleted file mode 100644
index cc208db9f..000000000
--- a/projectroot/usr/lib/tmpfiles.d/ssh.conf
+++ /dev/null
@@ -1 +0,0 @@
-d /run/sshd 0700 root root -