Warning for this section, this is only recommended if your only usage is web-hosting, apache is not meant to have access to home usersuser's folder (other suggestion at the end of the answer may be more suitable).
- Web/Apache group (
www-datagroup) must have all users using the service - Apache and the users need to have access to their respective
wwwwhile limiting access between each othersother
Like that, apache would have access to the necessary www directory and users wontwon't have access to other users folders.
The key here is the group permission is shared between users while apache it selfitself is a user that is not exposed to other user, for instance chown www:me /home/me keep me isolated from other user while granting access to apache and me (and chown me:www /home/me would let everyone on the group www access me folder)
This is why the default www location is under /var and not under the home directory, to let apache and the user have w/r to www without giving apache unnecessary access (like in this case access to the whole usersuser's folder)
If your home folder is only meant for www (web usage) you are fine with the current suggestion/config, now if you are using the system for additional purpose more than web hosting; then www should not reside on /home folder but on an otheranother location like /var; in that case you would need to remove ChrootDirectory usage and instead go for a classic config where the file access would be managed only by file access permission, here is some reading about restriction to a classic user...
If you want security, separation, web hosting plus other linuxLinux/server usage for each user, you would need to implement a different solution evolving virtualisation and/or sandboxing.
The implementation dependdepends on the targeted security level and the targeted usage. Thus one config could be great for one situation and at the same time bad for an otheranother situation.
Your current config is not far from a classic one where instead of ChrootDirectory classic file permissions, group, and user access level would be used to manage the separation between each ssh user. iI guess that you are just missing user access level on your config to achieve that. Here are some details on how to implement that here, here and here (that said using ChrootDirectory in addition to that is a good security practice)
First PermitRootLogin yes should never be used, instead add me user to the suders... Root will then be accessible through me user with sudo su or su
If you are targeting a hardened security, Kernel user space feature can be used, which will separate completely each usersuser, but this is a whole other config, this. This can be achieved with the native linuxLinux tools and/or firejail to separate files/network etc.
Also here are some interesting link on the topic:
Finally, regarding your config iI would just suggest