LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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


Reply
  Search this Thread
Old 11-19-2015, 12:35 AM   #1
validator456
Member
 
Registered: Apr 2013
Location: Rotterdam, The Netherlands
Distribution: Crunchbang Linux
Posts: 236

Rep: Reputation: Disabled
chroot question


I have a question to the professionals out there: when do you make use of chroot? In what kind of situations?
 
Old 11-19-2015, 12:59 AM   #2
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, Debian 12, Devuan & MX Linux
Posts: 9,528
Blog Entries: 15

Rep: Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178
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
 
Old 11-19-2015, 03:28 AM   #3
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
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.
 
Old 11-19-2015, 09:42 AM   #4
validator456
Member
 
Registered: Apr 2013
Location: Rotterdam, The Netherlands
Distribution: Crunchbang Linux
Posts: 236

Original Poster
Rep: Reputation: Disabled
Thank you for answers. The answers were most helpful.
 
Old 11-19-2015, 09:52 AM   #5
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,675

Rep: Reputation: Disabled
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.
Old 11-19-2015, 05:56 PM   #6
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, Debian 12, Devuan & MX Linux
Posts: 9,528
Blog Entries: 15

Rep: Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178
Quote:
Originally Posted by validator456 View Post
Thank you for answers. The answers were most helpful.
Your Welcome:-
 
Old 11-19-2015, 07:10 PM   #7
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,415

Rep: Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785Reputation: 2785
I'd also add that (for RHEL derived) bind installs as chrooted automatically - this sometimes catches people out
 
  


Reply

Tags
chroot


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
chroot question Bazzaah Slackware 9 07-16-2012 11:52 AM
Chroot question... linus72 Linux - Newbie 0 04-11-2009 07:11 AM
Chroot - question ef_ Linux - Software 3 10-14-2004 06:57 AM
vsftp and chroot question blubbfish Linux - Security 2 10-04-2004 11:03 AM
chroot question akwida Linux From Scratch 8 11-05-2003 04:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration