Files
cdba/shell/cdba-shell
Bjorn Andersson ffc91a6bf2 cdba-shell: Add some simple scripts for user maintenance
Introduce some scripts to allow storing users public keys in a git and
some hooks such that when this is pushed to the server the
authorized_keys file is re-generated.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
2022-08-18 23:07:40 -05:00

16 lines
258 B
Bash

#!/bin/sh
user=$1
cmd=${SSH_ORIGINAL_COMMAND%% *}
if [ "$cmd" = "git-upload-pack" -o "$cmd" = "git-receive-pack" ]; then
if grep -Fxq $user $HOME/admins ; then
exec sh -c "$SSH_ORIGINAL_COMMAND"
fi
echo Permission denied
exit 1
fi
exec cdba-server