How to Share files with vsftpd ftp server on LinuxJuly 5, 2007 at 2:38 pm | Posted in ftp, Linux, vsftpd | 1 Comment
Vsftpd is the most easy ftp server to setup.
On Ubuntu: sudo apt-get install vsftpd
On Fedora: (as root) yum install vsftpd
The configuration file for vsftpd is located in /etc/vsftpd.conf. The default configuration is a little bit paranoid, not so usable for file sharing. So use this configuration instead:
# Put in /etc/vsftpd.conf
# Don’t forget to change samurai into your local username
ftpd_banner=Welcome to blah FTP service.
Don’t forget to backup before you use this configuration.
sudo cp /etc/vsftpd.conf /root/
Now we must make writable directory for anonymous user.
sudo mkdir opendir
sudo chmod 777 opendir/
Ok, I explain this. In my local system, I have user named ‘samurai’. With this configuration, I can log into ftp server with local user, that is ‘samurai’. ‘samurai’ can go anywhere, create files, delete files, etc as long as he has sufficient permission.
With this configuration I can log into ftp server with anonymous user ( without username and password ). After logging in, the anonymous user jailed in /home/ftp directory ( pointed by anon_root ). I can’t go outside. I can download files from /home/ftp directory but not create, delete anything from this directory. But I can write and delete files in opendir. If I write files in opendir or upload files in opendir, the files automatically belong to ‘samurai’ user.
To run this server:
sudo /etc/init.d/vsftpd start
To stop it:
sudo /etc/init.d/vsftpd stop
To restart it:
sudo /etc/init.d/vsftpd restart
Now it is usable for file sharing