]> code.delx.au - dotfiles/blobdiff - bin/rsync-ssh-restrict
bin/rsync-ssh-restrict
[dotfiles] / bin / rsync-ssh-restrict
diff --git a/bin/rsync-ssh-restrict b/bin/rsync-ssh-restrict
new file mode 100755 (executable)
index 0000000..fc5e7b1
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+case "$SSH_ORIGINAL_COMMAND" in
+*\&*)
+echo "Rejected" >&2
+;;
+*\(*)
+echo "Rejected" >&2
+;;
+*\{*)
+echo "Rejected" >&2
+;;
+*\;*)
+echo "Rejected" >&2
+;;
+*\<*)
+echo "Rejected" >&2
+;;
+*\`*)
+echo "Rejected" >&2
+;;
+*\|*)
+echo "Rejected" >&2
+;;
+rsync\ --server*)
+ionice -c3 nice -n5 $SSH_ORIGINAL_COMMAND
+;;
+*)
+echo "Rejected" >&2
+;;
+esac
+