Quote:
Originally Posted by bambeklis
I can't remember how I fixed that, but now I need a good howto put some users into the chroot env and they only could execute those cmds which I enabled for them.
|
well he can not remember but this is the exact problem I am having. I have a feeling it has to do with user permissions since as su root I can chroot myself with no errors. What I am trying to do is..
Someone ssh's into my server and I would like to have them chrooted to there home directory. I need to have it where I can setup different types of users with slightly different commands. in .bash_profile I tried to add sudo chroot /home/jail/home/testuser and I get get the following.
Code:
testuser@bots's password:
Last login: Mon Aug 25 03:39:15 2008 from laptop.local
/usr/sbin/chroot: cannot change root directory to /home/jail/home/testuser: Operation not permitted
testuser@bots:~$
heres the .bash_profile
Code:
# ~/.bash_profile: executed by bash(1) for login shells.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.
# the default umask is set in /etc/login.defs
#umask 022
# include .bashrc if it exists
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# set PATH so it includes user's private bin if it exists
if [ -d ~/bin ] ; then
PATH=~/bin:"${PATH}"
fi
/usr/sbin/chroot /home/jail/home/testuser
I have tried this
http://www.linuxquestions.org/questi...t-user-646112/
and it does not seem to affect it at all. I still get the same messages.
with
Code:
sudo /usr/sbin/chroot /home/jail/home/testuser
in the mix I get the following
Code:
testuser@bots's password:
Last login: Mon Aug 25 13:27:19 2008 from laptop.local
/bin/bash: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory
testuser@bots:~$
I know how "well" documented this problem is, and figured since this is the only post anywhere I have found related to this exact problem it would be good to get a working solution for others to see.
I appreciate any help
Nyt
PS. Links I have used
Nice Jail Script
http://www.fuschlberger.net/programs...p-chroot-jail/
Guide
http://www.troubleshooters.com/linux/prepostpath.htm
initial Guide - (have to find it again)