LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-20-2009, 04:18 PM   #1
ludo33
Member
 
Registered: Feb 2009
Posts: 119

Rep: Reputation: 16
CHROOT tool


Hello guys,

Another newbie question, if you were to choose an easy to use CHROOT tool for Debian lenny, which one would it be?

I could play about for ages, hopefully by asking you good folk first I can save a whole lotta time.


Thanks all..
 
Old 08-20-2009, 04:24 PM   #2
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
Is there such a thing as a "CHROOT Tool"? I have never heard of one (which doesn't mean such a thing does not exist..), and I thought chroot is the "CHROOT Tool"


Sasha
 
Old 08-20-2009, 04:27 PM   #3
ludo33
Member
 
Registered: Feb 2009
Posts: 119

Original Poster
Rep: Reputation: 16
Smile Told...

..yah I was a newbie, I mean a GUI for the CHROOT tool ..sorry!
 
Old 08-20-2009, 04:45 PM   #4
KingX
LQ Newbie
 
Registered: Aug 2009
Location: San Jose, CA
Distribution: Slackware
Posts: 11

Rep: Reputation: 1
It's simply one command to change root and when you are done type "exit" to return to the original root. What do you plan to accomplish with a gui for this?
 
Old 08-20-2009, 04:46 PM   #5
RaptorX
Member
 
Registered: Jun 2009
Location: Emden, Germany
Distribution: Slackware 12.2, Slax 6.1
Posts: 254

Rep: Reputation: 37
once you chroot in to the alternate file system you can start the window manager of that particular system as far as I know.

I dont see any reason why you would need a GUI for chroot... once you issue the first command "chroot [path/to/change to]" then you forget about chroot altogether...

edit:

@KingX

you beat me to it...

Last edited by RaptorX; 08-20-2009 at 04:48 PM.
 
Old 08-20-2009, 04:51 PM   #6
ludo33
Member
 
Registered: Feb 2009
Posts: 119

Original Poster
Rep: Reputation: 16
And..

Quote:
Originally Posted by KingX View Post
It's simply one command to change root and when you are done type "exit" to return to the original root. What do you plan to accomplish with a gui for this?
the commmand is?
 
Old 08-20-2009, 04:53 PM   #7
RaptorX
Member
 
Registered: Jun 2009
Location: Emden, Germany
Distribution: Slackware 12.2, Slax 6.1
Posts: 254

Rep: Reputation: 37
Quote:
Originally Posted by ludo33 View Post
the commmand is?
as I mentioned in my post:

"chroot [path/to/chroot to]"

lets say you have a gentoo system in the folder /mnt/gentoo.

you do

"chroot /mnt/gentoo"

and thats it, /mnt/gentoo will be your / until you issue the exit command.
 
Old 08-20-2009, 04:54 PM   #8
forrestt
Senior Member
 
Registered: Mar 2004
Location: Cary, NC, USA
Distribution: Fedora, Kubuntu, RedHat, CentOS, SuSe
Posts: 1,288

Rep: Reputation: 99
The command is "chroot" (no quotes).

Forrest
 
Old 08-20-2009, 05:06 PM   #9
ludo33
Member
 
Registered: Feb 2009
Posts: 119

Original Poster
Rep: Reputation: 16
Oh No..

.. it's getting all technical now. I thought CHROOT was to put somebody in jail (So my son told me!) So that my user SSH123 only had access to the folder xyz. I've got debian lenny and the package manager offers me 1 million tools to do the job, which one do I go for?
 
Old 08-20-2009, 05:33 PM   #10
forrestt
Senior Member
 
Registered: Mar 2004
Location: Cary, NC, USA
Distribution: Fedora, Kubuntu, RedHat, CentOS, SuSe
Posts: 1,288

Rep: Reputation: 99
If you run the command "chroot /path/to/xyz" you will be in that chrooted environment. It isn't actually a jail (as seen in FreeBSD for example) though. If that is what you want, look at this site:

http://wiki.openvz.org/Main_Page

HTH

Forrest
 
Old 08-20-2009, 07:05 PM   #11
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,241

Rep: Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325
This is a good explanation of chroot http://en.wikipedia.org/wiki/Chroot.
Loosely speaking, there are 2 main uses

1. chroot temporarily eg when fixing up a broken system from the linux rescue mode
2. setting up a chrooted env permanently for a given user or process eg bind (DNS server) is usually setup that way these days.
See 16.1.3 http://www.linuxtopia.org/online_boo...5_ch-bind.html for an example.
 
Old 08-23-2009, 02:51 AM   #12
ludo33
Member
 
Registered: Feb 2009
Posts: 119

Original Poster
Rep: Reputation: 16
OK

Thanks for your help guys,

You all seem to think this is a simple task, according to http://www.debian.org/doc/manuals/se...sh-env.en.html it aint so easy!

Any thoughts?
 
Old 08-23-2009, 03:06 AM   #13
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
Ludo -- While using the CHROOT command is *extremely simple*, setting up a chroot-jail is a little more complex.

That said, having read the whole page you linked to, my opinion is that the instructions there are *very* good, and if you take the time to read the page and understand what they're telling you to do, you can do it

Note: it's just a personal thing of mine, but in regards to the section about needing to patch the sshd to accomplish one of the methods described, I don't like it. For the same reason that I prefer my kernel to be the way it is presented by kernel.org -- unpatched! The way I see it, if the developers figure it needs to be patched, then it *would* be patched already when it's released as stable. Again though, this is just my feeling on such things.

If you want to set up a chroot jail for ssh, read that page, follow the examples; take your time! And if/when there's something you don't grasp, well, that's why you're here (why we're all here) -- someone will help you out.

Cheers,
Sasha
 
Old 08-23-2009, 03:25 AM   #14
forrestt
Senior Member
 
Registered: Mar 2004
Location: Cary, NC, USA
Distribution: Fedora, Kubuntu, RedHat, CentOS, SuSe
Posts: 1,288

Rep: Reputation: 99
That article seems to be specifically talking about the difficulties of setting up an ssh server in a chrooted environment, not setting up a chrooted environment itself. Setting up a chrooted environment is pretty easy. Are you wanting to set up an ssh server in a chrooted environment? If so, how many users are you trying to support? If you are this new to Linux and the concept of a chroot, I'm guessing you probably don't even need an ssh server, but I could be wrong.

Forrest
 
Old 08-23-2009, 02:41 PM   #15
ludo33
Member
 
Registered: Feb 2009
Posts: 119

Original Poster
Rep: Reputation: 16
Once again..

..Thank you for your considered replies.

Ok dokey GrapefruiTgirl, why does the page I refered to have an "easy way" of doing what I require (sorry forrestt your wrong. I need SSH server and a jail for just a few users) and a "hard way" of achieving the same task!

My ever so simple question is "what is the right way to do it?"
I'm quite happy to dive in and experiment, but asking advice from other users that have "been to linux hell and back" makes much more sense to me

All the best...Ludo

Last edited by ludo33; 08-23-2009 at 02:48 PM.
 
  


Reply


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
chroot to run hd-installed distro's programs from chroot in live distro? silencestone Linux - Software 0 10-12-2007 07:29 AM
sudo /usr/bin/chroot /home/chroot /bin/su - xxx| /bin/su: user xxx does not exist saavik Linux - General 3 07-04-2007 11:30 AM
mount command not working in chroot. and now chroot not working mohit.jain Linux From Scratch 5 07-14-2006 04:57 AM
Chroot chamkila Linux - General 1 06-13-2003 06:46 AM
URLSCAN tool MS = Linux tool ? OB1 Linux - Security 3 10-05-2002 01:58 AM


All times are GMT -5. The time now is 11:13 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration