#!/bin/sh
# Adopted from answer by Celada
# https://security.stackexchange.com/a/118694
#

# Add a section like this to /etc/ssh/sshd_config:
#
# Match Group beegfs_hive_index
#       ForceCommand /path/to/bee_jail
#

set -f

set -- ${SSH_ORIGINAL_COMMAND}
case "$1" in
    find|ls|stats)
        ;;
    *)
        echo "Error: Command \"$1\" is not allowed" >&2
        exit 1
esac

exec "$@"
