You are not logged in.

#1 2024-12-12 11:18:41

Alberto-Trujillo
Member
From: Poole, Dorset, UK
Registered: 2017-02-21
Posts: 70

Help with Setting Up a Chroot Jail Environment”

Hi,
please can anyone help mi with this:

I am trying to create a “jail” environment (chroot) in a folder to conduct tests without affecting the main system.
Here is the procedure I am following:

# mount / --bind /mnt/
# mkdir my_root
# cp -a -R /mnt/. my_root/
cp: cannot copy a directory, '/mnt', into itself, 'my_root/.'
# umount /mnt/
# chroot my_root /bin/bash
chroot: failed to run command '/bin/bash': No such file or directory

Could someone please help me resolve these errors?

thank you.


"I believe I never knew what the word 'round' meant until I saw the Earth from space."
(Aleksei Leonov)

Offline

#2 2024-12-12 14:47:27

gromit
Administrator
From: Germany
Registered: 2024-02-10
Posts: 1,529
Website

Re: Help with Setting Up a Chroot Jail Environment”

Offline

#3 2024-12-19 16:13:31

Alberto-Trujillo
Member
From: Poole, Dorset, UK
Registered: 2017-02-21
Posts: 70

Re: Help with Setting Up a Chroot Jail Environment”

Hi gromit,

sorry for the delay in responding. Forces beyond my control!
Thank you very much for your prompt response. Reading the article you provided was very helpful. Thank you.
Having said that, I was looking for something different.

Let me explain: using the 'mkarchroot' script from the 'devtools' package you can quickly create a functional jail. But it takes up a lot of disk space (1G).
My question is if there is any way to install a much more minimalist system, with only what I need to use.

Thank you very much again for your interest in helping me.
A Trujillo


"I believe I never knew what the word 'round' meant until I saw the Earth from space."
(Aleksei Leonov)

Offline

#4 2024-12-19 19:35:16

loqs
Member
Registered: 2014-03-06
Posts: 18,884

Re: Help with Setting Up a Chroot Jail Environment”

Alberto-Trujillo wrote:

My question is if there is any way to install a much more minimalist system, with only what I need to use.

Please provide more details such as, what do you need to use in the jail? What connections if it it will have to outside the jail. Why alterative approaches such as systemd service based sand-boxing are not appropriate for your use case?

Offline

#5 2024-12-20 20:31:27

gromit
Administrator
From: Germany
Registered: 2024-02-10
Posts: 1,529
Website

Re: Help with Setting Up a Chroot Jail Environment”

Also I'm not sure if chroots are useful measure of security, instinctively I'd say you'd something more sophisticated.

Offline

Board footer

Powered by FluxBB