aboutsummaryrefslogtreecommitdiff
path: root/home/install_keys.sh
blob: b72203875fc701bdc44fe466018355c7c47bc8f2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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