Hi dears,
I setup a chroot environment for allowing user to connect my server without having access to the files.
This works pretty well, but the problem is that when they log in, they are put in the / of the chroot. I would like them to be put in /home/$user as soon as they log in so that they do not see the directories in /
what i did is to put in each ~/.bashrc file the following command:
cd $HOME
but this does ot work, in fact it seems that when they log in the bashrc file is not used.
here is my chroot command:
Code:
exec -c /usr/sbin/chroot /pub /bin/env -i \
HOME=/home/$USER USER=$USER TERM=$TERM PS1='\u:\w\$ ' \
/bin/bash --login
nb the home dir is in /pub
when i am logged in, if i run bash, then bashrc is executed.
Do someone have any idea on how to redirect each user to theire home directory