Linux & Mac

sshd

sudo vi /etc/sshd_config

#Subsystem sftp /usr/libexec/sftp-server
 Subsystem sftp internal-sftp
 Match User sftpuser
 X11Forwarding no
 AllowTcpForwarding no
 #ForceCommand internal-sftp -l VERBOSE
 ForceCommand internal-sftp
 ChrootDirectory /chroot/sftpusr

Linux

  1. yum install fuse
  2. Download the latest bindfs source tar-ball
  3. Compile & install: ./configure && make && sudo make install.

vi /etc/fstab
mmac.hensler.net:/Volumes/DATACUBE /mnt/ nfs defaults 0 0
/mnt/Media/Movies/ /chroot/sftpusr/movies/ fuse.bindfs perms=0700,mirror-only=sftpusr 0 0
/mnt/Media/Music/ /chroot/sftpusr/music/ fuse.bindfs perms=0700,mirror-only=sftpusr 0 0
/mnt/Media/TVShows/ /chroot/sftpusr/tvshows/ fuse.bindfs perms=0700,mirror-only=sftpusr 0 0

Mac

I had no luck getting bindfs and osfuse up and running with macOS Sierra. So I configured a virtual machine instead on top of CentOS 7, with everything running now.

Homebrew
brew install osfuse
brew install sshfs
brew install bindfs

make
install xcode and accept license
install xcode command line tools, xcode-select –install

https://www.freedesktop.org/wiki/Software/pkg-config/
./configure –with-internal-glib
make
sudo make install

download bindfs from http://bindfs.org
./configure && make && sudo make install
cp ./src/bindfs /user/local/bin

install osxfuse-3.5.2.dmg
install sshfs-2.5.0.pkg

System
System Preferences
allow remote login

create sftpusr
create sftpusers

bindfs.sh
sudo /usr/local/bin/bindfs -r -u sftpusr /Volumes/DATACUBE/Media/Movies /chroot/sftp/Movies
 sudo /usr/local/bin/bindfs -r -u sftpusr /Volumes/DATACUBE/Media/Music /chroot/sftp/Music
 sudo /usr/local/bin/bindfs -r -u sftpusr /Volumes/DATACUBE/Media/TV\ Shows/ /chroot/sftp/TVShows

launchagent

mount nfs volumes (OSXFUSE) at startup using launchAgent