My web users are jailed in their home folder by chroot. I need to give them rw sftp access to a directory on a block storage volume (mounted at /mnt/vol_01, thus outside of their home directory). All permissions are recursively set rw for user:www-data and I also set the same ACL permissions. For testing, I already tried to mount --bind the directory on the BSV inside the home folder of a user. Though the sftp user can read the files on the BSV, the uploads fail, with a sftp protocol error -31, even so, a file is created, but he gets a zero byte size. On the other hand, sftp account logged as root user will work with no issue.
How to fix the issue and give read/write access to the BSV directory to the chroot users? Thanks in advance for any clue :)
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hey Ralph 👋
If I recall correctly OpenSSH requires the chroot base dir to be owned by root and to be not writable. So try to keep
/home/user
asroot:root
withchmod 755
, then create a subdir like/home/user/uploads
and bind-mount your volume there:Make sure the mounted dir has the right permissions (
user:www-data
,chmod 775
). Insshd_config
use something like this:Restart SSH with
systemctl restart sshd
, and give it another try.- Bobby