diff options
Diffstat (limited to 'ansible/roles/common/files/ssh-transfer-only.sh')
-rwxr-xr-x | ansible/roles/common/files/ssh-transfer-only.sh | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/ansible/roles/common/files/ssh-transfer-only.sh b/ansible/roles/common/files/ssh-transfer-only.sh new file mode 100755 index 0000000..c1f0624 --- /dev/null +++ b/ansible/roles/common/files/ssh-transfer-only.sh | |||
@@ -0,0 +1,11 @@ | |||
1 | #!/usr/bin/env bash | ||
2 | |||
3 | # Only allow ssh commands starting with 'scp' or 'rsync' | ||
4 | case $SSH_ORIGINAL_COMMAND in | ||
5 | scp*) | ||
6 | $SSH_ORIGINAL_COMMAND ;; | ||
7 | rsync*) | ||
8 | $SSH_ORIGINAL_COMMAND ;; | ||
9 | *) | ||
10 | echo "Not allowed with this key: $SSH_ORIGINAL_COMMAND" ;; | ||
11 | esac | ||