If I got it right, chroot restricts user's access to a given directory only. Looks like useradd
has this option (Debian 10).
# useradd --help | grep "chroot"
-R, --root CHROOT_DIR directory to chroot into
Looks simple, yet nobody seems to be recommending it:
- Create an user in linux that can access only a specific folder
- https://www.tecmint.com/restrict-ssh-user-to-directory-using-chrooted-jail/
Why? Is it not portable or secure/reliable enough?