Is it possible to have users on linux, who's home directory is still the default /home/joe but when they login via ssh/sftp, they are chroot at /apps/web/?

Basically I wanted to keep all users files .bashrc, .bash_profile, .ssh in their home /home/joe directory, but they should only have access to /apps/web and further when they login via ssh/sftp.

I am on CentOS 5.6 x86.

Update

I put the following in /etc/ssh/sshd_config but when I try and sftp in with a user in the group deploy it is not working.

Match Group deploy
        ChrootDirectory /apps/web
        AllowTcpForwarding no
        ForceCommand internal-sftp
link|improve this question

48% accept rate
feedback

2 Answers

mkdir -m 751 /home/joe-chroot /home/joe-chroot/{/apps/web,home}
ls -lad 

Justin can try above command try out

link|improve this answer
feedback

So I got the sftp working with:

Match Group deploy
        ChrootDirectory /apps/web
        AllowTcpForwarding no
        ForceCommand internal-sftp

And the permissions of /apps/web need to be user and group owned by root.

link|improve this answer
what are your directory permissions on /apps/web? (ls -la) – gravyface Sep 7 '11 at 20:58
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.