Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've recently run into some problems while trying to setup a FTP server a certain way. I have a client who has a LOT of data put into one folder. The client then has various directories by which the data is organized. At the end (of the "directory filter") they have a symbolic link that points to a file in the massive data folder. E.g

/lab/directory1/type2/data/owner/lab/bla/bla/file---->/lab/data/filexyz

In order to replicate and setup a "FTP" server, I simply created a directory called /lab/data/ and copied all the data on there. I then just copied the symbolic link folder structure.

I then setup vsftpd. Created a local user with a false bin and set that users home directory to /lab The problem I run into is that when I have chroot_local_user=YES enabled in the config file, the user is unable to get the file the server gives 550 Failed to open file. why is this the case. The symbolic link is pointing to a file that is in their home directory. However when I have chroot_local_use=NO the user is able to download the files seamlessly. Is there way to enable the user to get files via symbolic links that are in their home directory while being chroot jailed?

I've been scratching my head over this. Thanks!

share|improve this question

2 Answers 2

A symbolic link is a pointer to the "right" file. But if that original file is outside the jail then you can't access it. This is the goal of a jail. Otherwise a normal user could create a symbolic link in the jail to /etc/passwd and just read it. What a security risk!

So jailed is jailed. Probably a hard link will do the job, as this is a "copy without duplicating the used size". And for the FTP server it is like a normal file (with all the problems).

share|improve this answer
    
But here is the thing, the symbolic link is inside the home directory of the user. I cannot create hard links because the files are not on the same file system. They are on EBS volumes in amazon mounted on a folder inside the users home directory. –  Falcata Aug 15 '11 at 17:29
    
The symbolic link itself is the problem. Not the target of the symbolic link. So probably this is why it is called vsftpd (very secure ...). You could try ProFTPd which is able to follow symlinks. –  mailq Aug 15 '11 at 18:02
    
Thanks for the reply maliq. I'm looking into proFTPd right now, is there no way to make it work with VDFTPD? –  Falcata Aug 15 '11 at 18:44
    
No way with symlinks. Use hard links, no jail or the method mentioned by @Eno. –  mailq Aug 15 '11 at 18:48
    
I keep on bugging you :(. So I tried using proftpd and I followed the tutorial here: proftpd.org/docs/howto/Chroot.html I cannot see the symbolic link: e.g: I want to create a link to /lab/data/009.txt in the folder /lab/somefilter/filter1/test/ by the name of thisfile.txt so /lab/somefilter/filter1/test/thisfile.txt ---> /lab/data/009.txt This does not seem to work. Any thoughts? Thanks :) –  Falcata Aug 15 '11 at 20:19

You should use something like mount --bind

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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