I had a task and that was to establish ftp server on a server ran on Debian Lenny OS. I just want to share my experience, maybe one of you meet the same task, so you don’t need to worry anymore. Ok, this is what I did :
- Install vsftpd package by running
apt-get install vsftpd, if you’re not the root run it like this
sudo apt-get install vsftpd.
- Make a new account, let’s say ‘ftp-user’. Run this command to create a new user
adduser ftp-user. (again, if you’re not root user you have to put sudo in front of the command).
- Well done, now let’s modify the vsftp configuration file a bit, it’s located at
/etc/vsftpd.conf. Open it and find this code
- You almost there. But in my case, I add extra security to my ftp server by uncomment this option
chroot_local_user=YES. This option will limited the user access only in their home directory.
- The last step is restarting the vsftpd by running
If you want to make your ftp open for public access, then you’ve done it! Just connect the server via ftp tools, fill in your host name, then fill the username field with ‘anonymous’ or ‘ftp’ and leave the password field blank, then connect. But, if you want to restrict the access with a certain account then continue the instruction.
anonymous_enable=YES and change it to
anonymous_enable=NO. This code will deactivate ‘ftp’ and ‘anonymous’ account, so you won’t be able to access the server with those two accounts anymore.
next, uncomment this code
local_enable=YES. This option will allow local user to connect to ftp server.
next step, uncomment this code
write_enable=YES. This option will allow connected local user to upload files to the server via ftp.
Voila! You just finished establishing an ftp server on your Debian server. Well, this is only a brief instruction and if you want to go detail, maybe I can share you next time.