From 5c1724875cdbc4bbdad621838168070b64c530cf Mon Sep 17 00:00:00 2001 From: nold Date: Fri, 21 Jan 2022 10:16:42 +0100 Subject: [PATCH] Change: Add restrict to client keys & output debian version --- data/run.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/data/run.sh b/data/run.sh index ba38093..63ec0eb 100755 --- a/data/run.sh +++ b/data/run.sh @@ -15,9 +15,11 @@ AUTHORIZED_KEYS_PATH=/home/borg/.ssh/authorized_keys # Append only mode? BORG_APPEND_ONLY=${BORG_APPEND_ONLY:=no} +source /etc/os-release echo "########################################################" echo -n " * Docker BorgServer powered by " borg -V +echo " * Based on ${PRETTY_NAME}" echo "########################################################" echo " * User id: $(id -u borg)" echo " * Group id: $(id -g borg)" @@ -74,7 +76,7 @@ for keyfile in $(find "${SSH_KEY_DIR}/clients" ! -regex '.*/\..*' -a -type f); d borg_cmd="${BORG_CMD} --append-only" fi - echo -n "command=\"$(eval echo -n \"${borg_cmd}\")\" " >> ${AUTHORIZED_KEYS_PATH} + echo -n "restrict,command=\"$(eval echo -n \"${borg_cmd}\")\" " >> ${AUTHORIZED_KEYS_PATH} cat ${keyfile} >> ${AUTHORIZED_KEYS_PATH} done chmod 0600 "${AUTHORIZED_KEYS_PATH}"