summaryrefslogtreecommitdiff
path: root/tmpfiles.d
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2022-09-15 19:35:36 +0100
committerLennart Poettering <lennart@poettering.net>2022-09-23 09:30:00 +0200
commit4cebd207d1487e1944fd81bbaf63678dade3ed4e (patch)
tree6e2c582b7571356a735b50e78f132d3ab4f31243 /tmpfiles.d
parent27f6aa0b7112024c1236957abd909071b06869a8 (diff)
downloadsystemd-4cebd207d1487e1944fd81bbaf63678dade3ed4e.tar.gz
tmpfiles: add lines for provisioning ssh keys for root by default
With this, I can now easily do: systemd-nspawn --load-credential=ssh.authorized_keys.root:/home/lennart/.ssh/authorized_keys --image=… --boot To boot into an image with my SSH key copied in. Yay!
Diffstat (limited to 'tmpfiles.d')
-rw-r--r--tmpfiles.d/provision.conf5
1 files changed, 5 insertions, 0 deletions
diff --git a/tmpfiles.d/provision.conf b/tmpfiles.d/provision.conf
index a4d7aaf99b..3c56f42d58 100644
--- a/tmpfiles.d/provision.conf
+++ b/tmpfiles.d/provision.conf
@@ -15,3 +15,8 @@ f^ /etc/issue.d/50-provision.conf - - - - login.issue
# Provision a /etc/hosts file from credentials.
f^ /etc/hosts - - - - network.hosts
+
+# Provision SSH key for root
+d /root :0700 root :root -
+d /root/.ssh :0700 root :root -
+f^ /root/.ssh/authorized_keys :0600 root :root - ssh.authorized_keys.root