Thursday, September 24, 2009

Change vsftpd anonymous login default directory

The default anonymous login directory is /var/ftp/
To change the default from /var/ftp to any other directory (say /data)
edit /etc/vsftpd/vsftpd.conf file add entry.
local_root=/data
save the file and restart the vsftpd services using command
services vsftpd restart.

Change the default ftp user account home folder to point to the new location.
before change ftp account info in /etc/passwd file
ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin
chmod -d /data ftp # To change the home directory for ftp user.
ftp:x:14:50:FTP User:/data:/sbin/nologin
Now when you login as anonymous user, the login directory will be /data.