-   Linux - Server (
-   -   vsftpd cannot access NFS-mounted directories (

guertin 05-17-2012 03:48 PM

vsftpd cannot access NFS-mounted directories
I'm trying to set up an FTP server running vsftpd. (Normally we used SFTP, but in this instance we need to use regular FTP.) I have local_enable=YES set in vsftpd.conf so that users can access their own home directories. The problem is that /home is mounted from an NFS server, and vsftpd isn't playing well with NFS. The FTP login proceeds, and the user is authenticated, but the ftp session ends with:

500 OOPS: cannot change directory:/home/<username>
Login failed.

If I change the user's home directory to a local directory, it works fine, but that's not something I can really do long-term.

I have read that SELinux interferes with NFS-mounted directories in vsftpd, but I have SELinux completely disabled, and I'm still getting the "500 OOPS error".

I've been playing around with NFS settings and vsftpd settings, and I haven't been able to get around this. What am I missing?

We're running RHEL 5 on the NFS server, and RHEL 6 on the FTP server, with vsftpd 2.2.2-6.

kbp 05-17-2012 08:20 PM

Are you using automount for the home dirs or is it permanently mounted via /etc/fstab ?

guertin 05-17-2012 09:07 PM


Originally Posted by kbp (Post 4681341)
Are you using automount for the home dirs or is it permanently mounted via /etc/fstab ?

It's mounted with /etc/fstab -- no automount. I've tried using different mount options in the fstab file, but none of the options have had any effect on this.

kbp 05-17-2012 09:46 PM

I've got a test vm with auto-mounted home dirs, I'll install vsftpd and see if local accounts will work - get back to you soon.

kbp 05-17-2012 10:05 PM

It seems to be working for me with automounted homedirs but the nfs server is v6 as opposed to your v5. Did you enable chroot_local_user and/or have any accounts in /etc/vsftpd/chroot_list ?

guertin 05-18-2012 07:38 AM

I've done it with chroot_local_user enabled and disabled, and the same error occurs either way.

Just to see what would happen, I tried automounting /home instead of mounting it in /etc/fstab. In that case, the user is authenticated correctly as usual, /home/<username> is automounted, but the user still gets:

500 OOPS: cannot change directory:/home/<username>
Login failed.

at the ftp prompt.

Maybe I'll try setting up a fresh RHEL 6 NFS server to see if that behaves any differently.

grim76 05-18-2012 09:45 AM

Are you setting up local users, or are you setting up virtual users?

guertin 05-18-2012 01:21 PM

Got it! I set up a test RHEL 6 NFS server, and I could connect to that right out of the box. So then it became an exercise to see what was different between that and my existing RHEL 5 NFS server. To be honest, I'll admit I kind of lost track about which changes got it to work, so I'm still not sure what I did to get it working. But I suspect it one of the iptables settings in /etc/sysconfig/iptables. At any rate, it's working now. Thanks for all the help.

All times are GMT -5. The time now is 04:18 PM.