Recently I was rebuilding an old “virtual user” vsFTPd server, this time using Chef. Of course I started by looking for a decent vsftpd cookbook. There are several popular ones, for example:
- The vsftpd “supermarket” cookbook might be fine for some users, but it’s not been updated since 2010, and it seems to lack a good way to override most of the default vsftpd.conf settings.
- TheSerapher’s chef-vsftpd cookbook on github is popular but it’s opinionated with respect to defaults and seems to be aimed at setting up FTP for local users.
I was disappointed that these didn’t suit our needs, and a little bummed I wasted so much time reading the code to figure that out. But by that time, I was so brushed up on vsftpd config that, against all advice, I started from scratch and created the basic_vsftpd cookbook.
My goal was to create a general purpose cookbook designed on three principles:
- To be as simple as possible, only about installing vsftpd and nothing else
- To let you create any possible vsftpd configuration
- To set no defaults and make no assumptions about the intended use
- OK, four. Using code that’s easy to read and understand
In other words, the goal was to create a solid base recipe that is easy to use or extend via a wrapper cookbook. The pleasing result was that after building/testing this cookbook, using it to deploy a real FTP server was a dream. I’ve made this a public repo in hopes others will find it useful as well.
“A basic and fully configurable cookbook for the vsftpd package.” on github, and at the Chef supermarket.
- default – installs and configures the vsftpd package
- chroot_list – Creates a chroot_list file for vsftpd
- userlist – Creates a userlist file for vsftpd
- user_conf – Creates a user configuration file in the vsftpd user_config_dir directory