P
P
Pavel_Quantorium2020-02-15 13:05:42
linux
Pavel_Quantorium, 2020-02-15 13:05:42

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

5 answer(s)
N
none7, 2020-02-15
@none7

Google: chroot user isolation
https://www.tecmint.com/restrict-ssh-user-to-direc...

H
HighMan, 2020-02-15
@HighMan

LXC. A slightly more advanced solution.

S
shurshur, 2020-02-16
@shurshur

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...

M
metajiji, 2020-02-17
@metajiji

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.

V
Valentine, 2020-02-20
@ProFfeSsoRr

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 question

Ask a Question

731 491 924 answers to any question