Linux System Admins Blog

System admins of Promet – an e-commerce, high availability Open Source web shop – share their findings

Linux System Admins Blog header image 2

vsftpd logging timestamp

December 9th, 2008 · 2 Comments

While investigating some ftp transfers issues we realized that there was something wrong with the logs generated by vsftpd. The timestamps reported in the vsftpd log were wrong, and the fact that they were always 5 hours behind the actual time made us think this was caused by a timezone issue. The system running this was the latest Centos 5.2 with stock vsftpd package.

After further investigation we realized that vsftpd was not using the system timezone settings but was always logging its messages using GMT. Why would anyone want this? I have no idea, but imo they should change the default value to use the system timezone as that is what the majority of people would expect. In order to fix this, you just have to add to the vsftpd.conf the following line:
use_localtime=YES
as we can see from vsftpd manual page (man vsftpd.conf) if undefined, this defaults to “NO“:
use_localtime – If  enabled, vsftpd will display directory listings with the time in your local time zone. The default is to display GMT. The times returned by the MDTM FTP command are also affected by this option.
Default: NO

After changing this variable as with any other vsftpd options, you have to restart the vsftpd service to activate the change.

Related Posts:

Tags: CLI · Centos · sysadmin

2 responses so far ↓

  • 1 John Hinton // Oct 20, 2009 at 10:06 pm

    I think the above should read

    use_localtime=YES

    Otherwise, vsftpd will not restart due to a config error.

    Good info!

  • 2 marius // Oct 21, 2009 at 6:11 pm

    @John: thank you for spotting that. I just updated the post.

    Cheers,
    - Marius -

Leave a Comment