Issues setting up SSH/SFTP on chroot users with mounted drive


I am attempting to create some shared FTP storage by setting up a storage box attached to a VPS with CIFS. I want to be able to use SSH/SFTP, but not let each users see each others files. I have gotten it to work by having everything run locally. However, when I mount my storagebox at /home I suddenly cannot connect to SSH/SFTP with the created accounts. SSHing just closes down without errors and SFTP just gives me the error that I cannot connect to the server. FTP works as normal without issues.

I have tried with a wide variety of permission. chmod 0770, 0775, 0777 and so forth and making root the owner or not. If i unmount the drive and have /home locally then everything works as expected again.

I assume there it must be a permission thing, but I am not sure. Or is doing this just not feasible? I just cannot see why it would not work.

Anyone could guide me on the right path here? Thanks

Using debian 11 with latest version of Webmin/virtualmin.

Firewall port issue?

I don’t think so. Individually everything works. With the main root account I can transfer/create/delete files onto the mounted drive through SSH/(S)FTP. So I don’t see anything being blocked by a Firewall. The issue is purely when a new virtual server is created onto the mounted drive. The new user cannot SSH/SFTP onto the drive, only FTP. Although, I can as root SSH/SFTP into root and makes changes to the folders.