Answer the question
In order to leave comments, you need to log in
Linux Subsystem for Linux?
Set up a chroot for the user. But after that, bash stopped working. Tell me, please, how to configure the bash shell and some Linux commands, as well as certain programs in chroot ?!
Answer the question
In order to leave comments, you need to log in
Google: chroot user isolation
https://www.tecmint.com/restrict-ssh-user-to-direc...
Because after chroot, the specified directory will be the root of the file system for the process, but where is /bin/bash? He's not there. It must be created there. Next, you need some libraries from /lib. Devices from /dev. Utilities, at least coreutils. Etc. etc. The easiest way is to immediately make a minimal system in the right directory using debootstrap.
PS: Based on the wording of the topic of the question, I thought that now it would be necessary to talk about chroots, namespaces, openvz and virtual machines, but here, it turns out, that was not the point...
ldd + strace, if you want to get confused and do chroot after all. For information, pay attention to the articles on preparing a chroot environment for working via ssh, there will be details with scripts.
What problem are you solving with chroot? This is a specific utility - usually needed to restore or install linux. Judging by the question, you may want an isolated environment - and this is container technology, chroot does not isolate anything, but essentially replaces the paths to the files and that's it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question