I have troubles with setup a SFTP with chroot in "public" folder. Each client on my server has 3 to X accounts.
These three accounts are:
- USER - system account only for internal use, requires full access to home dir of client
- USER-www - also system account only for internal use, every customer app works with this uid, and requires full access to serval sub-folders in USER home dir
- USER-ftp - account only for sftp access, with chroot id ~/apps
Problem is, that ~/apps doesn't have root:root privileges and can not have. Also i want have ability to create sub-accounts for USER-ftp, which have chroot in ~/apps/APP_NAME/app and full access in that directory (so ~/apps/APP_NAME/app folder must not have root:root privileges).
So, here are my questions:
- Is SSH in any way allows to chroot user into dir thats do not have root:root privileges?
- How to setup USER-ftp chroot dir into ~/apps, and all ftp subaccount into ~/apps/APP_NAME/app? Mention that part of your user name will also be the name of the folder to which will have access (eg. user USER.my_first_app-ftp will have chroot in ~/apps/my_first_app/app).
- In addition, how to let the USER-ftp to log in as the USER, without '-ftp' and, eg. USER.my_fist_app-ftp as the USER.my_fist_app?