From 5acda3eaeabae9045609539303a8c12c4ce401f1 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 25 Apr 2016 12:01:08 +0200 Subject: merge with latest dev version --- .../system/basic.target.wants/ssh-auth-keys.service | 1 + .../data/etc/systemd/system/ssh-auth-keys.service | 7 +++++++ .../data/opt/openslx/scripts/systemd-ssh_auth_keys | 20 ++++++++++++++++++++ core/modules/ssh-auth-keys/module.build | 11 +++++++++++ core/modules/ssh-auth-keys/module.conf | 3 +++ 5 files changed, 42 insertions(+) create mode 120000 core/modules/ssh-auth-keys/data/etc/systemd/system/basic.target.wants/ssh-auth-keys.service create mode 100644 core/modules/ssh-auth-keys/data/etc/systemd/system/ssh-auth-keys.service create mode 100755 core/modules/ssh-auth-keys/data/opt/openslx/scripts/systemd-ssh_auth_keys create mode 100644 core/modules/ssh-auth-keys/module.build create mode 100644 core/modules/ssh-auth-keys/module.conf (limited to 'core/modules/ssh-auth-keys') diff --git a/core/modules/ssh-auth-keys/data/etc/systemd/system/basic.target.wants/ssh-auth-keys.service b/core/modules/ssh-auth-keys/data/etc/systemd/system/basic.target.wants/ssh-auth-keys.service new file mode 120000 index 00000000..2bddb0ca --- /dev/null +++ b/core/modules/ssh-auth-keys/data/etc/systemd/system/basic.target.wants/ssh-auth-keys.service @@ -0,0 +1 @@ +../ssh-auth-keys.service \ No newline at end of file diff --git a/core/modules/ssh-auth-keys/data/etc/systemd/system/ssh-auth-keys.service b/core/modules/ssh-auth-keys/data/etc/systemd/system/ssh-auth-keys.service new file mode 100644 index 00000000..20a7b8f9 --- /dev/null +++ b/core/modules/ssh-auth-keys/data/etc/systemd/system/ssh-auth-keys.service @@ -0,0 +1,7 @@ +[Unit] +Description=Enable SSH keys in authorized_keys.d/ folder + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/opt/openslx/scripts/systemd-ssh_auth_keys diff --git a/core/modules/ssh-auth-keys/data/opt/openslx/scripts/systemd-ssh_auth_keys b/core/modules/ssh-auth-keys/data/opt/openslx/scripts/systemd-ssh_auth_keys new file mode 100755 index 00000000..9a64b83a --- /dev/null +++ b/core/modules/ssh-auth-keys/data/opt/openslx/scripts/systemd-ssh_auth_keys @@ -0,0 +1,20 @@ +#!/bin/ash + +AUTH_KEYS_DIR="/root/.ssh/authorized_keys.d/" +AUTH_KEYS_FILE="/root/.ssh/authorized_keys" + +# do we even have the directory? +[ ! -d "$AUTH_KEYS_DIR" ] && echo "No such directory: $AUTH_KEYS_DIR" && exit 0 + +mkdir -m 700 $(dirname "$AUTH_KEYS_FILE") 2>/dev/null + +# ok, lets cat them in the real file +for KEY in "$AUTH_KEYS_DIR"/* ; do + if ! cat $KEY >> "$AUTH_KEYS_FILE" ; then + echo "Could not add '$KEY' to '$AUTH_KEYS_FILE'" + exit 1 + fi +done + +# all done, all good +exit 0 diff --git a/core/modules/ssh-auth-keys/module.build b/core/modules/ssh-auth-keys/module.build new file mode 100644 index 00000000..97e93235 --- /dev/null +++ b/core/modules/ssh-auth-keys/module.build @@ -0,0 +1,11 @@ +fetch_source() { + : +} + +build() { + : +} + +post_copy() { + : +} diff --git a/core/modules/ssh-auth-keys/module.conf b/core/modules/ssh-auth-keys/module.conf new file mode 100644 index 00000000..0cd03752 --- /dev/null +++ b/core/modules/ssh-auth-keys/module.conf @@ -0,0 +1,3 @@ +REQUIRED_BINARIES="" +REQUIRED_LIBRARIES="" +REQUIRED_DIRECTORIES="" -- cgit v1.2.3-55-g7522