From c538d401c0f75e8e5c69408508c989b857b0e76a Mon Sep 17 00:00:00 2001 From: Evan Pratten Date: Mon, 23 Oct 2023 12:43:56 -0400 Subject: [PATCH] Add script to generate scp acls --- configs/scripts/scp-make-upload-acl | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 configs/scripts/scp-make-upload-acl diff --git a/configs/scripts/scp-make-upload-acl b/configs/scripts/scp-make-upload-acl new file mode 100755 index 0000000..faf4f1e --- /dev/null +++ b/configs/scripts/scp-make-upload-acl @@ -0,0 +1,17 @@ +#! /bin/sh +set -e + +# Require an argument containing a directory +if [ $# -ne 3 ]; then + echo "Usage: scp-make-upload-acl " + exit 1 +fi + +# Require the directory to exist +if [ ! -d "$1" ]; then + echo "Directory $1 does not exist" + exit 1 +fi + +# If all is ok, then print out the authorized_keys line that restricts that key to that directory +echo "command=\"scp -t $1\",no-agent-forwarding,no-port-forwarding,no-pty,no-user-rc,no-X11-forwarding $2 $3"