Linux - NewbieThis 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
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.
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.
tried googling a lot but couldnt find any
LQ has site search. We've got a lot of topics going on. Try it next time. You won't be disappointed, even if your search-fu is at an alltime low.
Both should point you in the right direction, I hope this was helpful (it doesn't make any sense to reinvent the wheel by copy&pasting the howtos here). Let us know if you run into trouble configuring them.
Chroot is a mean of jumping from a Linux A into another Linux B.
The steps involved are just booting up Linux A either an installed Linux in the hard disk or from a Live CD, make a temporary partition in /mnt, mount the partition of Linux B and do a chroot.
The result afterward is you will be using the kernel of Linux A but have the access of the Bash shell of Linux B. This facility allows you to repair Linux B especially if it is unbootable. If LInux B is in partition hda7 the commands after booting Linux A to chroot to Linux B are
Code:
mkdir /mnt/hda7
mount /dev/hda7 /mnt/hda7
chroot /mnt/hda7
After the above you will be inside hda7 or Linux B to do whatever you want. To get back to Linux A you need to type
Code:
exit
If the Linux A kernel is compatible with Linux B you can use the GUI too but in general Bash shell or terminal mode is one that is always supported.
Since you need root privilege to chroot so on gaining access into the Linux B you will remain as root and so it can be a form of hacking because you break into an installed Linux without knowing any of its passwords.
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,304
Rep:
i have a bunch of scripts on my system similar to this. say gentoo is installed on hda6. generally you can start another instance of X after chrooting with startx -- :1
you can be running several versions of linux at once along with their graphical environments, switching between themw ith ctl-alt-F7 . . F8 . . . F9
some of the info is from a multiple distributions for development howto on the web.
thank you all for your help...i tried out all the pages that you all had provided but im sorry i couldnt understand much....though i did try out the man pages and from a bit of reading i did...
#ldd /bin/ls
after getting all the shared libraries i cp'd them to a directory (/home/dipshi) in the same structure that i got...for eg.../home/dipshi/lib/(shared libraries)..i then even copied ls and bash into the directories
inthe same i did #ldd /bin/bash and cp'd all the libraries in the appropriate structure...and then i did
#chroot /home/dipshi/
bash-3.00#
the ls was working fine...
right now im trying to chroot the /var/tomcat-jakarta and /usr
ill be neeing your help with that..ill get back whenever i get a problem
hello everyone...as i had told u i would be working on /var/jakarta...
well i did chroot it and made bin, etc, usr/sbin, lib under /var/jakarta-tomcat and copied all the libraries into it......although i could go into jakarta after chroot ing it...i also wanted to create a user under jakarta so that the user could only work under the webapplication direc under jakarta...so i also copied /usr/sbin/useradd to jakarta in the appropriate dir format..after chrooting i tried useradd username, it didnt give any errors so i assumed that a user was created..similarly i copied userdel but when i tried to run userdel..it gave me an error that there was no such user....
the following dir were made by me
on opening /var/jakarta/etc/passwd..it showed me entries that a user was created with all the normal entries including a home dir...but when i personally created a home dir under jakarta, no home dirwas created for the user
I tried out jailkit and worked on the example that was given in the documentation available on the jailkit website..every command mentioned in the documentation jailkit worked fine but I couldnt figure out how would I come to know whether the user is inside the jail.....
for eg, if I do #chroot /home/username...then by doing
bash#pwd I get / as the new root directory instead of /home/username
but my problem is that I cant figure out how to do the same thing using jailkit....
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,304
Rep:
i actually enjoy short bursts of leet speech. reading your posts, i didn't even notice the u and plz myself. i think it gives more flavor to things.
on the main question, perhaps you can do a minimal install of linux on a different drive or partition, then get the chroot working, and start deleting stuff out of the environment. perhaps one of those minimal 1 2 or 3 floppy distributions or something like peanut. http://www.linuxlinks.com/Distributions/
I tried out jailkit and worked on the example that was given in the documentation available on the jailkit website..every command mentioned in the documentation jailkit worked fine but I couldnt figure out how would I come to know whether the user is inside the jail.....
Oh that's easy. If you log in as root and ls -l / you will see the contents of the system's root directory - then if you log in as the chrooted user, you will see that user's home directory contents when you ls -l /
Quote:
whansard i actually enjoy short bursts of leet speech. reading your posts, i didn't even notice the u and plz myself. i think it gives more flavor to things.
Personally I find it hard to follow when trying to concentrate on what the person is actually trying to ask, because it's so darn annoying I'm spending more time thinking about how damn lazy people are than I spend thinking about the user's issue. It's lame because so many people think using shorthand which might be appropriate in an SMS message makes them look cool on a technical board.
chroot - Wikipedia https://en.wikipedia.org/wiki/Chroot
Jump to Linux host kernel virtual file systems and configuration files - A chroot on Unix operating systems is an operation that changes the apparent root directory for the current running process and its children. A program that is run in such a modified environment cannot name (and therefore normally cannot access) files outside the designated directory tree.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.