
Wednesday, 16th April 2008 at 08:47pm
I needed to set up an FTP server since WordPress wanted it in order to do the automatic plug-in upgrade. I've never needed one before since I've just been using SCP.
I looked around for an FTP server and was about to install FTPd, before someone told me that vsftpd was a much better daemon to get, so I did (using sudo apt-get install vsftpd).
Well, that was simple enough, but now we have to change some of the configuration file. It's actually pretty simple since it's well commented. You can nano the file /etc/vsftpd.conf to get at the options; remember to use those helpful switches!
I decided to disable anonymous access, since all I really need is to get my WordPress to update a few files, and it won't do that anonymously. Change the setting on line 23 to disable it. I want to just use local users for when I'm logging into FTP, enable that on line 26; that means that I'll use the same user name and password that I use for PuTTY to get shell access. We obviously want to write stuff when we're using FTP (instead of just reading) so make sure line 29 is uncommented.
I changed my local_umask to 022. What this does is basically makes any new file I make have the permissions of 755 (777 - 022), meaning everyone can read and execute, but only the owner can write.
Since I'm letting local users access via FTP, I want to restrict them to just their home directories, so they can't play around with files outside of their /home/username directory. That's done on line 105. Of course, I want to allow myself to access anywhere, so I uncommented line 110 and 112.
That's all the edits that I made to that file. Now though, we need to add ourselves to the list of users allowed outside their home directory. It's a simple (empty) file at /etc/vsftpd.chroot_list by default, and you just need to put your user name there.