VSFTPD : 550 Failed to change directory

By default VSFTPD does not allow the browsing of symbolic links. When you try to browse sym links you will get a message saying,

       550 Failed to change directory

In order to overcome this you can use the mount command. Here are the steps :

[[email protected] ftpuser]# pwd
/home/ftpuser
[[email protected] ftpuser]# mkdir NEW_DIR
[[email protected] ftpuser]# mount --bind /var/log/ NEW_DIR
[[email protected] ftpuser]# ls -l
total 184196
drwxr-xr-x 4 root    root         4096 Oct 12 14:33 NEW_DIR
[[email protected] ftpuser]# chgrp ftpuser NEW_DIR
[[email protected] ftpuser]# ls -l
total 184196
drwxr-xr-x 4 root    ftpuser      4096 Oct 12 14:33 NEW_DIR

As you can see from this example, we create a link in the ftpusers home directory to link through to the /var/log/ directory. Once done we change the group on the directory to ensure there are no permission issues.

Additional Notes 

You will also want to make your binded mount permanent. To do this add the following line to /etc/fstab.

/my/real/dir /to/mount/dir  none    bind    0       0

If you want to remove the binded mount, umount the path and then remove the directory.

[[email protected] ftpuser]# ls -l
total 8
drwxr-xr-x 2 root root 4096 Oct 21 00:41 VirtualMachines
[[email protected] ftpuser]# umount VirtualMachines/
[[email protected] ftpuser]# rm -ivr VirtualMachines/
rm: remove directory `VirtualMachines/'? y
removed directory: `VirtualMachines/'
Rick Donato

Want to become a Linux expert?

Here is our hand-picked selection of the best courses you can find online:
Linux Mastery course
Linux Administration Bootcamp
and our recommended certification practice exams:
AlphaPrep Practice Tests - Free Trial