fir3net
PPS-Firenetbanner-780.5x190-30-03-17

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 :

[root@server ftpuser]# pwd
/home/ftpuser
[root@server ftpuser]# mkdir NEW_DIR
[root@server ftpuser]# mount --bind /var/log/ NEW_DIR
[root@server ftpuser]# ls -l
total 184196
drwxr-xr-x 4 root    root         4096 Oct 12 14:33 NEW_DIR
[root@server ftpuser]# chgrp ftpuser NEW_DIR
[root@server 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.

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

Tags: FTP

About the Author

RDonato

R Donato

Rick Donato is the Founder and Chief Editor of Fir3net.com. He currently works as a Principal Network Security Engineer and has a keen interest in automation and the cloud.

You can find Rick on Twitter @f3lix001