PDA

View Full Version : How can I chroot sftp-only users into a directory different from their homes?




carlosribas
Sep 2, 2013, 04:17 PM
I want to set up a new sftp server with a public folder for a few users. I have an ODM server and I want to use the users from this ODM to authenticate into the sftp server. However, I want to chroot the users into a new folder created in this sftp server, instead of use their home directory from ODM.

I created a group in the sftp server and I added this group to a user from ODM, but I dont know how to set up my sshd_config file. I tried this without success:

Match Group group_name
ChrootDirectory /path_to_group_name/
ForceCommand internal-sftp
AllowTcpForwarding no

I appreciate any help.



carlosribas
Sep 3, 2013, 01:58 PM
I partially solved my problem using this site:

http://thefragens.com/2011/12/chrootd-sftp-on-mac-os-x-server/