Wednesday, September 7, 2011

How to Setup FTP and an anonymous FTP server with vsftpd with upload enable

Setup vsftpd in CentOS
yum install vsftpd
chkconfig vsftpd on
service vsftpd start
cp /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsftpd.conf.original
anonymous_enable=NO
listen=YES
local_enable=NO
anonymous_enable=YES
write_enable=NO
anon_root=/var/ftp
anon_max_rate=2048000
xferlog_enable=YES 


   
 
 
 
Setup Anonymous FTP with upload enable
#
vim /etc/vsftpd/vsftpd.conf
anon_root=/myftpDir/pub
listen_port=21
listen=YES
local_enable=YES
anonymous_enable=YES
write_enable=YES
anon_max_rate=2048000
xferlog_enable=YES
ftp_username=ftp
anon_upload_enable=YES
anon_mkdir_write_enable=YES
#anon_other_write_enable=YES
anon_world_readable_only=NO
ftpd_banner=(All Activities are monitored on this system!!)
log_ftp_protocol=YES
no_anon_password=YES
local_umask=022

save & exit by :wq

Now
Make sure that root directory  is not  being writable
The ftp root directory MUST NOT be owned by ftp for security reasons (it should be root:root).

Change the permission as below:
chmod u-w /myftpDir/pub
mkdir /myftpDir/pub/upload
chown u-w /myftpDir/pub/upload






No comments:

Post a Comment