Archive for November, 2012

VSFTP chroot not defaulting to home directory

November 10, 2012

VSFTP has some confusing configuration parameters

# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
#chroot_local_user=YES
#chroot_list_enable=YES
# (default follows)
#chroot_list_file=/etc/vsftpd/chroot_list

Reading this you would think that in order to chroot all users you would just uncomment

chroot_local_user=YES

If you do when users login they are placed in / which isn’t desirable. Some forum posts suggest uncommenting local_root but it isn’t in my config file.

It isn’t ideal but the following works with the downside that you have to add users explicitly to the file. When users connect they are correctly placed in their home directories and cannot go up a level.

#chroot_local_user=YES
chroot_list_enable=YES
# (default follows)
chroot_list_file=/etc/vsftpd/chroot_list

Whilst this worked I found it annoying that my original effort didn’t work. I eventually got it to work with the following

chroot_local_user=YES
#chroot_list_enable=YES
# (default follows)
#chroot_list_file=/etc/vsftpd/chroot_list
user_sub_token=$USER
local_root=/home/$USER
Advertisements

Amazon CloudFront Reporting / Log Processing

November 8, 2012

One of our new customers has just gone live with our service using Amazon CloudFront. They are a pretty high traffic website with a fairly large number of images, i.e. > 50,000 and growing daily.

Amazon CloudFront reporting is non-existent. There simply isn’t any.

We have a custom reporting system so we process the CloudFront log files to generate these reports. CloudFront generates a lot of log files! It generates way too many files for my liking. It generates approximately 3,500 log files a day. This is 35 times more files than our existing CDN.

I am pretty sure when Amazon add more POPs we’ll see the number of files increase. This isn’t the case with our existing CDN.

If we use CloudFront with other customers the problem will only get worse as we have to use a CloudFront Distribution per customer. This will result in another set of files.

3,500 files x 100 customers is 350,000 files per day.