A chroot Help!!! Hurry!!!

A chroot Help!!! Hurry!!!

Post by Mark l » Tue, 02 Jul 2002 16:15:39



I try to create some safe shell for some users and I use chroot.I havd
created the directory /bin,/lib/,/tmp and copied the files
"bash","chroot" to the /bin.
I add the following line to the file ".bash_profile":

chroot /home/safeshell /home/safeshell/bin/bash

It can't work. The error message is "chroot:can't change the root
directory to
/home/safeshell:Permission Denied

Why???My os is Turbo Linux 6.1
Thanks!!!

 
 
 

A chroot Help!!! Hurry!!!

Post by Julian T. J. Midgl » Tue, 02 Jul 2002 20:27:32




>I try to create some safe shell for some users and I use chroot.I havd
>created the directory /bin,/lib/,/tmp and copied the files
>"bash","chroot" to the /bin.
>I add the following line to the file ".bash_profile":

>chroot /home/safeshell /home/safeshell/bin/bash

>It can't work. The error message is "chroot:can't change the root
>directory to
>/home/safeshell:Permission Denied

It looks as though you are trying to execute chroot as a non-root
user.  Only root can chroot.

Furthermore, the path to the shell should be /bin/bash, not
/home/safeshell/bin/bash, since the chroot command will attempt to
execute the shell after /home/safeshell has become /, not before.

Julian

--
Julian T. J. Midgley                      http://www.xenoclast.org/
Cambridge, England.                          PGP Key ID: 0xBCC7863F