FTP Error 550 when trying to access a folder via symbolic link

Posted on

Problem :

I’m configuring svftp on a linux machine.

At the moment local users can login via ftp and they will see listened their home dir.
They have write acces to it.

No I want the users to write in de /var/www/ dir. Therefore I created an new group apache. Added users to the group and gave the group write access to /var/www. Via the terminal all users can write .var/www/. I created a link in the home directory to /var/www via

ln -s /var/www/ /home/user/www

ls gives:

drwxr-xr-x 2 orangetux orangetux 4096 Jun 23 15:06 ftp
lrwxrwxrwx 1 orangetux orangetux 21 Jun 23 15:00 www -> /var/www/

But when I use FTP I see the link but I cannot follow it. Error 550 which means file not found or bad access.

How can I solve this, so that the users have access to /var/www via their home dir?

Solution :

Found it here

Q) Can I restrict users to their home directories? A) Yes. You are
probably after the setting: chroot_local_user=YES

But a more secure solution is written down below.

Q) Why don’t symlinks work with chroot_local_user=YES? A) This is a
consequence of how chroot() security works. As alternatives, look into
hard links, or if you have a modern Linux, see the powerful “mount

Leave a Reply

Your email address will not be published.