aboutsummaryrefslogtreecommitdiff
path: root/home/install_keys.sh
diff options
context:
space:
mode:
authorMitchell Riedstra <mitch@riedstra.dev>2022-12-28 23:52:07 -0500
committerMitchell Riedstra <mitch@riedstra.dev>2022-12-28 23:52:07 -0500
commitc5017fb5f5d5ff3d438f6a07403ac0590554a8db (patch)
treed85d027ea1f5f273aece22868fc437e541b99be7 /home/install_keys.sh
parentdf50ddfe09ef3176972998e6aca3482da5f22427 (diff)
downloadalpine-cgit-c5017fb5f5d5ff3d438f6a07403ac0590554a8db.tar.gz
alpine-cgit-c5017fb5f5d5ff3d438f6a07403ac0590554a8db.tar.xz
Update to the latest Alpine Linux. Few tweaks to scripts and entrypoint.
Diffstat (limited to 'home/install_keys.sh')
-rwxr-xr-xhome/install_keys.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/home/install_keys.sh b/home/install_keys.sh
new file mode 100755
index 0000000..b722038
--- /dev/null
+++ b/home/install_keys.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+# Useful for generating git-only authorized keys.
+# If say you don't want to enable shell access for all of your git users.
+# Note, that this doesn't prevent people from deleting branches, force
+# pushing and such.
+boiler='no-port-forwarding,no-agent-forwarding,command="git-shell -c \"$SSH_ORIGINAL_COMMAND\""'
+
+if [ -z "$1" ] ; then
+ echo "You need to supply an argument which contains a set of authorized_keys files"
+ exit 1;
+fi
+
+IFS="
+"
+for key in $(cat "$@" | sed -e'/^#/d' ) ; do
+ printf "%s %s\n" "$boiler" "$key"
+done