Add script to generate scp acls
This commit is contained in:
parent
0be3d1464f
commit
c538d401c0
17
configs/scripts/scp-make-upload-acl
Executable file
17
configs/scripts/scp-make-upload-acl
Executable file
@ -0,0 +1,17 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Require an argument containing a directory
|
||||||
|
if [ $# -ne 3 ]; then
|
||||||
|
echo "Usage: scp-make-upload-acl <directory> <key> <comment>"
|
||||||
|
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"
|
Loading…
x
Reference in New Issue
Block a user