diff options
author | Sebastian | 2016-04-25 12:01:08 +0200 |
---|---|---|
committer | Sebastian | 2016-04-25 12:01:08 +0200 |
commit | 5acda3eaeabae9045609539303a8c12c4ce401f1 (patch) | |
tree | 7e71975f8570b05aafe2ea6ec0e242a8912387bb /core/modules/ssh-auth-keys | |
parent | initial commit (diff) | |
download | mltk-5acda3eaeabae9045609539303a8c12c4ce401f1.tar.gz mltk-5acda3eaeabae9045609539303a8c12c4ce401f1.tar.xz mltk-5acda3eaeabae9045609539303a8c12c4ce401f1.zip |
merge with latest dev version
Diffstat (limited to 'core/modules/ssh-auth-keys')
5 files changed, 42 insertions, 0 deletions
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="" |