Ubuntu – How to symlink one directory to a chrooted (jailed) directory

directoryjailsymlinkUbuntu

'm trying to create a folder (directory) for a jailed user on my server that will allow him to access another folder outside of his jail. I'm trying to do this with symlink but all it does is create a file, instead of a folder. He's using FTP and I want a folder that will behave like all his other folders, except it links to a separate folder. Is there a reason why my symlinks all show up as files? Thanks.

Best Answer

I think what you want here, is to bind mount the target directory inside the jail of the user. You can't symlink out of a jail. Look at this, for instance:

mount --bind /media/sdb2/mydocs/archive /home/username/archive