I'm new to chroot jails; so far I've setup bash using this tutorial, and I've been able to login with the user through ssh secured with a public key.
The SSH configuration takes care of running the chroot jail:
AllowUsers <username>
Match User <username>
ChrootDirectory "/home/<username>"
/etc/sshd_config
Basically I took every one of the dependencies listed and copied it to /home/username/<rest-of-the-path-to-dependency-file> and did the same with the executable.
I did nothing with linux-vdso as it doesn't play by the same rules.
They only thing I can do in the jail is cd and execute programs, my shell prompt appears like this:
-bash-4.4$
I added another program and in the same manner as the tutorial above, adding ldd dependencies and copying over the executable to the directory IU found it in
When I run the program it creates a directory and folders in /.config/taskell/config.ini and a couple of other files.
But when the program runs it gives me an error related to the encoding of the file /home/username/.config/taskell/config.ini: hGetContents: invalid argument (invalid byte sequence), but when I run it in my bash shell on the computer directly it works fine.
Did setting up the chroot jail change the way the shell or this program interprets the files it is reading? The -bash-4.4$ prompt seems to indicate that there's some kind of defaults set that aren't there when I initially log in using the regular prompt.
Additionally, I'm trying to do this on WSL Ubuntu 18.08 which appears to have something to do with the encoding issue I linked.
The only three commands I wish to be able to run are the command I'm trying to run, git, and vim, but I'm starting with this one and not having much luck.