« 你必须承认土也是一种艺术 Linux下查看Apache的请求数 »

解决vsftpd日志时间问题

最近发现vsftpd的日志记录/var/log/vsftpd.log里显示的文件修改时间与实际的系统时间不一致,一般都差了8个小时。搜索了一下,发现因为默认情况下, vsftpd使用的是GMT标准时间,而不是Local Time。修改也很简单:

# 修改vsftpd 的配置文件 vsftpd.conf
# 不一定是这个路径
vi /etc/vsftpd/vsftpd.conf

在配置文件里加入一行:
use_localtime=YES

保存之后重启 vsftpd 即可。

如果是用 xinetd 的方式来启动,要注意把配置文件中的listen参数值改为NO,否则 vsftpd 重启之后问题依旧。

vsftpd日志格式如下:
Mon Aug 25 08:58:59 2008 1 219.142.129.122 8797 /message.htm b _ o r ftp ftp 0 * c
Mon Aug 25 08:58:59 2008 1 219.142.129.122 3925 /top.htm b _ o r ftp ftp 0 * c
Mon Aug 25 08:58:59 2008 1 219.142.129.122 4257 /welcome.htm b _ o r ftp ftp 0 * c
Mon Aug 25 08:59:14 2008 1 219.142.129.122 9159 /pet.inc.php a _ i r ftp ftp 0 * c
Mon Aug 25 09:01:45 2008 1 219.142.129.122 623 /footer.htm b _ i r ftp ftp 0 * c

“解决vsftpd日志时间问题”

4条回复
  1. 贱人啊~~~~

  2. 搜索来的,用use_localtime=YES解决问题了。

  3. 发现改完,ftp里文件的上传修改时间仍然相差8小时。。。

  4. @啤酒盖子 重启下vsftpd的服务,就好了。估计你是没重启服务。

回复留言

*
To prove you're a person (not a spam script), type the security word shown in the picture.
Anti-Spam Image

你可以使用XHTML标签: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>