Home
About
Blog
Media Gallery

SFTP chroot Mount Access


A normal symbolic link won't work in a chrooted env. But mount --bind will.

Let's say you've already mounted a windows share outside of chroot:
mount -t cifs -o username=u,password=p,uid=n,gid=n //server/share /mountpoint

Then you can access it from a user SFTP client/connection with:
mkdir /home/user/my-mountpoint
mount --bind /mountpoint /home/user/my-mountpoint

Or just mount a share directly. I runĀ a chmod 700 runlevel script for reboot consistency.

Original Post: Jan 28th, '22 15:45 CET.

Tags: GNU/Linux