[X2Go-Commits] [live-build-x2go] 02/12: added authorized_keys download support
git-admin at x2go.org
git-admin at x2go.org
Fri Dec 23 12:00:47 CET 2016
This is an automated email from the git hooks/post-receive script.
x2go pushed a commit to branch feature/openbox
in repository live-build-x2go.
commit d211debd524a0f437682e9359af576f5a9904705
Author: Stefan Baur (BAUR-ITCS) <kontakt at baur-itcs.de>
Date: Fri Dec 16 02:31:58 2016 +0100
added authorized_keys download support
---
.../includes.chroot/lib/live/config/2150-setsshkey | 44 ++++++++++++++++++++
1 file changed, 44 insertions(+)
diff --git a/config/includes.chroot/lib/live/config/2150-setsshkey b/config/includes.chroot/lib/live/config/2150-setsshkey
new file mode 100755
index 0000000..45572f7
--- /dev/null
+++ b/config/includes.chroot/lib/live/config/2150-setsshkey
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+SetSSHKey ()
+{
+
+# Output startup message
+#
+echo -n " setsshkey"
+
+
+PUBKEYURL=$(cat /proc/cmdline | \
+ tr ' ' '\n' | \
+ awk -F'=' ' /^pubkey=/ { print $2 }')
+
+if [ -n "$PUBKEYURL" ] ; then
+
+ # Set Keyfile
+ #
+ mkdir -p /root/.ssh
+ chmod 600 /root/.ssh
+ touch /root/.ssh/authorized_keys
+ chmod 600 /root/.ssh/authorized_keys
+
+ if echo "$PUBKEY" | grep -q "^tftp://" ; then
+ PUBKEYSERVER=$(echo "$PUBKEYURL" | sed 's#^tftp://\([^/]*\)/.*$#\1#' )
+ PUBKEYPATH=$(echo "$PUBKEYURL" | sed 's#^tftp://[^/]*/\(.*\)$#\1#' )
+ if [ -n "$PUBKEYSERVER" ] && [ -n "$PUBKEYPATH" ] ; then
+ while ! atftp $PUBKEYSERVER -g -r $PUBKEYPATH -l /root/.ssh/authorized_keys ; do
+ echo "Waiting for SSH Public Key ..."
+ sleep 5
+ done
+ fi
+ else
+ while ! wget -q -O - $PUBKEYURL >/root/.ssh/authorized_keys ; do
+ echo "Waiting for SSH Public Key ..."
+ sleep 5
+ done
+ fi
+fi
+
+}
+
+SetSSHKey
+
--
Alioth's /srv/git/code.x2go.org/live-build-x2go.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/live-build-x2go.git
More information about the x2go-commits
mailing list