Ssh is a great way to access a Linux system. But I never liked the idea that a user could see other parts of the file system (folder names and file names) even though they couldn't view or change actual files provided thier permissions were correct. Chroot lets you tie a user a folder but it's complex because you have to create a self contained environment with the base files,base commands and libraries. A script named make_chroot_jail.sh written by Wolfgang Fuschlberger. Go to his web page www.fuschlberger.net to get it. It takes all the pain out of this as you just pass it a username and it creates the user, sets permission and creates the whole environment.
And when you no longer need that user, it's easy to get rid of them. Just the standard userdel does everything needed.
But somewhere along the line it stopped working with Debian. I figured how to fix it and make a patch you can apply to the original makechrootjail.sh to get a version that works with Debian 8 (aka Jessie) and Debian 9 (aka strech).
So download the patch make_chroot_jail_jessie.patch and apply it. Note that this is meant to be applied to the RELEASE 2008-04-26 version.
If you don't want to apply the patch yourself, here is the patched version.
It works exactly the same as before.
For the curious, here is what I changed:
Date: 8/21/2016, Updated: 8/4/2018