Search This Blog

Showing posts with label vsftp. Show all posts
Showing posts with label vsftp. Show all posts

Tuesday, August 27, 2013

vsftpd weird issue with nfs mount missing nolock option

Just had weird issue with nfs mount.

A folder access vsftpd, can view the file, but can't download.

The first one linked to NetApps, it works without nolock option.
The second linked to RHEL 4 nfs service, it only works with nolock option.

# cat /etc/fstab

10.144.246.12:/vol/ftp_storage /home/storage nfs rw,bg,hard,tcp,rsize=32768,wsize=32768,timeo=600 0 0
192.168.190.118:/home/storage /home/storage/storage_DND/nrm nfs rw,bg,hard,nolock,tcp,rsize=32768,wsize=32768,timeo=600 0 0


The second nfs mount was within the first nfs mount.

Wednesday, August 21, 2013

VSFTP give each user different directory than home directory

Usually when you create user for vsftp, it will go to it's own home folder.

Like user: mds
Home Folder: /home/mds

To change this, What you need to use is a combo of user_config_dir and local_root.
In the main config file /etc/vsftpd/vsftp.conf you have an entry like:


chroot_local_user=YES
user_config_dir=/etc/vsftpd/users


Inside that directory (/etc/vsftpd/users) you have a config file with the same name as the user (/etc/vsftpd/users/mds), and inside that file you have:


local_root=/var/www/sites/
dirlist_enable=YES
download_enable=YES
write_enable=YES


Then the user will be direct to /var/www/sites/ through ftp.
But ssh login folder will not change.

Don't forget remove the [local_root] in the main config file /etc/vsftpd/vsftp.conf.