1

I've set up an FTP server using vsftpd on a Centos 5.10 machine. This is my target directory on the server:

/var/www/supercoolstuff

I can connect from a Windows XP machine using WinSCP then navigate to the above directory as long as I enter in the full path.

ftp://adambrown_ftp:PASSWORD@192.168.15.150/var/www/supercoolstuff/

When I try to connect directly from Windows Explorer using the above line I receive this error:

550: Failed to change directory.

Looking in the /var/log/vsftpd/vsftpd.log file I can see that it is trying to change to the target directory relative to the FTP users home directory:

FTP response: Client "192.168.100.2", "200 NOOP ok."
FTP command: Client "192.168.100.2", "CWD/home/adambrown_ftp/var/www/supercoolstuff"
FTP response: Client "192.168.100.2", "550 Failed to change directory."

How can I allow the FTP user to connect directly to the target directory?

1

Are you talking about something that only you will be using, or do you have a larger user population?  If it's just you, try making a symbolic link called var in your home directory on the server pointing to /var; e.g.,

ln -s /var /home/adambrown_ftp/var

Of course you can do this for multiple users, but then you have the management problems of how you do this for each user when you create their account, and how you prevent them from removing the link.

0

Since it's a centOS question with a permission issue, don't forget that by default Selinux is activated, thus you should have a look to the permission of the directory with:

ls -Z
  • What is the difference between using ls -Z and ls -l? – blarg Mar 9 '15 at 15:22
  • ls -Z shows you the permission Selinux has assigned on files and directory, and Selinux is a lot more restrictive. For instance if you created"/home/adambrown" that belongs to adambrown:adambrown, and that you give 777 permissions on this folder, Selinux would not allow the ftp daemon to write to it. There is a whole lot to learn about Selinux, but I'd be curious as what shows the output of "ls -Z" – Adonis Mar 10 '15 at 9:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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