ssh_filter_btrbk.sh − ssh command filter script for btrbk
[−p|−−restrict−path <path>] [−l|−−log] [−−sudo]
ssh_filter_btrbk.sh restricts SSH commands to btrfs commands used by btrbk. It examines the SSH_ORIGINAL_COMMAND environment variable (set by sshd) and executes it only if it matches commands used by btrbk. The accepted commands are specified by the "−−source", "−−target", "−−delete" and "−−info" options.
Note that the following btrfs commands are always allowed: "btrfs subvolume show", "btrfs subvolume list".
Note that commands for stream compression (pipes through gzip, pigz, bzip2, pbzip2, xz, lzo, lz4) as well as rate limiting (pipes through "pv -L") are always allowed.
Example line in /root/.ssh/authorized_keys on a backup target host:
command="ssh_filter_btrbk.sh −−target −−delete −−restrict−path /mnt/btr_backup" ssh−rsa AAAAB3NzaC1...hwumXFRQBL firstname.lastname@example.org
Allow commands for backup source: "btrfs subvolume snapshot", "btrfs send". Equivalent to "−−snapshot −−send".
Allow commands for backup target: "btrfs receive", "realpath" and "cat /proc/self/mounts".
Allow commands for subvolume deletion: "btrfs subvolume delete". This is used for backup source if snapshot_preserve_daily is not set to “all”, and for backup targets if target_preserve_daily is not set to “all”.
Allow commands for stream compression (pipes through gzip, pigz, bzip2, pbzip2, xz, lzo, lz4). Needed if stream_compress is set.
Allow informative commands: "btrfs subvolume find−new", "btrfs filesystem usage". This is used by btrbk info and diff commands.
Allow btrfs snapshot command: "btrfs subvolume snapshot".
Allow btrfs send command: "btrfs send".
Allow btrfs receive command: "btrfs receive".
−p, −−restrict−path <path>
Restrict btrfs commands to <path>.
Log ACCEPT and REJECT messages to the system log.
Allow btrfs commands to be called via sudo. Enable this if you have "backend btrfs-progs-sudo" in your btrbk configuration file.
Please refer to the btrbk project page http://digint.ch/btrbk/ for further details.
btrbk(1), btrbk.conf(5), btrfs(1)
Axel Burri <email@example.com>