Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
11-19-2015, 12:35 AM
|
#1
|
Member
Registered: Apr 2013
Location: Rotterdam, The Netherlands
Distribution: Crunchbang Linux
Posts: 236
Rep:
|
chroot question
I have a question to the professionals out there: when do you make use of chroot? In what kind of situations?
|
|
|
11-19-2015, 12:59 AM
|
#2
|
LQ Guru
Registered: Dec 2011
Distribution: Slackware, Debian 12, Devuan & MX Linux
Posts: 9,528
|
Chroot is a way of isolating applications from the rest of your computer, by putting them in a jail. This is particularly useful if you are testing an application which could potentially alter important system files, or which may be insecure.
Chroot can be used in a number of instances.
https://en.wikipedia.org/wiki/Chroot
Code:
SEE ALSO
chroot(2)
The full documentation for chroot is maintained as a Texinfo manual.
If the info and chroot programs are properly installed at your site,
the command
info coreutils 'chroot invocation'
should give you access to the complete manual.
GNU coreutils 8.21 February 2013 CHROOT(1)
lines 32-56/56 (END)
HTH
|
|
|
11-19-2015, 03:28 AM
|
#3
|
Senior Member
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
|
chroot can also be used to reset the root password coming from a rescue system. Image you lost root password, start a live cd, then mount the "original" system and chroot to it. After that passwd root sets a new password.
Another example is if you installed a system through debootstrap to finalize the process you chroot to the new system. Or if you have a virtual disk that you want to access outside of the virtual machine. Mount it through loop and chroot to it.
|
|
|
11-19-2015, 09:42 AM
|
#4
|
Member
Registered: Apr 2013
Location: Rotterdam, The Netherlands
Distribution: Crunchbang Linux
Posts: 236
Original Poster
Rep:
|
Thank you for answers. The answers were most helpful.
|
|
|
11-19-2015, 09:52 AM
|
#5
|
LQ Sage
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,675
Rep:
|
Here is a bit unusual way to use chroot. I have a Zotac box as MythTV frontend. Binary distros keep crashing on it, but Gentoo runs rock solid. To run Gentoo one has to compile alot. This little box really can't take compiling, it overheats and shuts down. So I export the root filesystem from Zotac over NFS, mount it from another computer, chroot into Zotac and build everything not using Zotac resources at all.
|
|
1 members found this post helpful.
|
11-19-2015, 05:56 PM
|
#6
|
LQ Guru
Registered: Dec 2011
Distribution: Slackware, Debian 12, Devuan & MX Linux
Posts: 9,528
|
Quote:
Originally Posted by validator456
Thank you for answers. The answers were most helpful.
|
Your Welcome:-
|
|
|
11-19-2015, 07:10 PM
|
#7
|
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,415
|
I'd also add that (for RHEL derived) bind installs as chrooted automatically - this sometimes catches people out
|
|
|
All times are GMT -5. The time now is 11:02 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|