LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 01-05-2004, 09:24 PM   #1
secret_ident
LQ Newbie
 
Registered: Jan 2004
Posts: 10

Rep: Reputation: 0
Exclamation chroot on redhat 9.0


when I created it, I get a bash file in there, no folder.
so I get these errors

[root@localhost oxide]# chroot /home/shell/oxide /bin/bash --login
chroot: /bin/bash: No such file or directory

so I add a bash folder and I still get an error
[root@localhost oxide]# chroot /home/shell/oxide /bin/bash --login
chroot: /bin/bash: Permission denied


why is this?
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\//////////////////////////////////////////
what I'm wanting to do is:
have the folder "oxide" as a root folder for the shell user "oxide" and so he can only access files/folders in his directory only. and I'd want to set that on each account I setup, is that possible?

Last edited by secret_ident; 01-05-2004 at 09:30 PM.
 
Old 01-14-2004, 12:27 PM   #2
n1wil
LQ Newbie
 
Registered: May 2002
Posts: 20

Rep: Reputation: 0
I am trying to accomplish the same thing. Want to keep a user ONLY in their Home Dir.

anyone have any answers to this one? I am new to Linux. I tried to read the help that came with chroot, but didn't understand it. Could someone please give a syntax example is the following conditions are true:

home dir is: /home/johndoe

User ID is: johndoe

I only want "johndoe" to be able to navigate/see files in his own home dir only.

Any help is MUCH appreciated! thanks!
 
Old 01-14-2004, 10:54 PM   #3
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
I think you guys might be interested in setting up a chroot jail for users, which is a variation of simply chrooting an application but isn't quite the same thing. It's a bit more complex than just chrooting bash to the users home dir. There is an entire section of the Security references thread here that is entirely devoted to chrooting and setting up chroot jails. There are several comprehensive walk-throughs and even entire project devoted to the task (Jail Chroot Project) that offers a suite of tools which do alot of the work for you.

Last edited by Capt_Caveman; 01-14-2004 at 10:55 PM.
 
Old 01-17-2004, 05:13 PM   #4
secret_ident
LQ Newbie
 
Registered: Jan 2004
Posts: 10

Original Poster
Rep: Reputation: 0
I used the "jail_1.9 " of one of the links you gave us, I followed exactly what it said to do, but I get this error:

[root@localhost src]# make
gcc -Wall -g -D__LINUX__ -DDEBUG=0 -I . -c generic_helpers.c -o generic_helpers.o
make: gcc: Command not found
make: *** [generic_helpers.o] Error 127
 
Old 01-17-2004, 05:54 PM   #5
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
make: gcc: Command not found
Do you have GCC (Gnu C Compiler) installed? If you're not sure do:

rpm -qa | grep gcc

If it's not installed, you should be able to find it on one of the Redhat 9.0 installation CDs.
 
Old 01-17-2004, 06:00 PM   #6
secret_ident
LQ Newbie
 
Registered: Jan 2004
Posts: 10

Original Poster
Rep: Reputation: 0
[root@localhost src]# rpm -qa | grep gcc
compat-gcc-7.3-2.96.118
libgcc-3.2.2-5
compat-gcc-c++-7.3-2.96.118

I take is as I have it installed
 
Old 01-17-2004, 06:32 PM   #7
secret_ident
LQ Newbie
 
Registered: Jan 2004
Posts: 10

Original Poster
Rep: Reputation: 0
I renamed the files from .c to .h except for jail.c and now I get this error:

[root@localhost src]# make
gcc -Wall -g -D__LINUX__ -DDEBUG=0 -I . jail.c -o jail generic_helpers.h passwd_helpers.h terminal_helpers.h && \
cp jail ../bin
/bin/sh: line 1: gcc: command not found
make: *** [jail] Error 127


have any simpler ideas to keep someone in their some directory?

Last edited by secret_ident; 01-17-2004 at 06:42 PM.
 
Old 01-17-2004, 07:28 PM   #8
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 69
Looks like you have everything installed except the c compiler itself. If you had it installed you should have gotten:
compat-gcc-7.3-2.96.118
libgcc-3.2.2-5
compat-gcc-c++-7.3-2.96.118
..and...
gcc-3.2.2-5

Or something similar. (gcc-3.2.xxx)

Install the gcc-3.2.-xxx.rpm off the install disks and re-login. Then make should be able to find gcc. Also I wouldn't change those filenames unless indicated in the HOWTO.

---EDIT----

You should be able to test if gcc is installed by simply doing:

Code:
$ gcc
gcc: no input files

if it isn't installed you should get:
$ gcc
bash: gcc: command not found

Last edited by Capt_Caveman; 01-17-2004 at 07:32 PM.
 
  


Reply



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
sudo /usr/bin/chroot /home/chroot /bin/su - xxx| /bin/su: user xxx does not exist saavik Linux - General 3 07-04-2007 10:30 AM
Cannot 'chroot' dtournas Linux - General 5 05-17-2004 03:34 AM
Help!! How to use Chroot on Redhat 7.2 eluo1996 Linux - Security 6 01-05-2004 09:21 PM
VSFTPD Config and CHROOT REDHAT 8 SteveT Linux - Newbie 10 10-17-2003 02:25 AM
Apache, Redhat 9, chroot problem TonyTran Linux - Security 1 10-14-2003 10:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 06:43 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