when users ftp to server the timezone reflected is UTC but the server is set to TZ in localtime

Guys,

Need your help coz my server runs in local time GMT +8, but when client use ftp and login, the resulting timestamp seen in each file is in UTC format. We need to set that the time should be the same as GMT +8 when in ftp session.
I am using RHEL 5.3.

root@]# ll
total 1740
-rw-r--r-- 1 sc users  2044 Sep 17 16:18 CFSCV00001.DAT
-rw-r--r-- 1 sc users  2044 Sep 17 16:19 CFSCV00002.DAT
-rw-r--r-- 1 sc users  2044 Sep 17 16:19 CFSCV00003.DAT
-rw-r--r-- 1 sc users  2044 Sep 17 16:20 CFSCV00004.DAT
-rw-r--r-- 1 sc users  2044 Sep 17 16:20 CFSCV00005.DAT
-rw-r--r-- 1 sc users  2044 Sep 17 16:21 CFSCV00006.DAT
-rw-r--r-- 1 sc users  2044 Sep 17 16:21 CFSCV00007.DAT
-rw-r--r-- 1 sc users  2044 Sep 17 16:22 CFSCV00008.DAT
-rw-r--r-- 1 sc users  2044 Sep 17 16:22 CFSCV00009.DAT
-rw-r--r-- 1 sc users  2044 Sep 17 16:23 CFSCV00010.DAT
-rw-r--r-- 1 sc users  2044 Sep 17 16:23 CFSCV00011.DAT
-rw-r--r-- 1 sc users  2044 Sep 17 16:24 CFSCV00012.DAT
-rw-r--r-- 1 sc users  2044 Sep 17 16:24 CFSCV00013.DAT
-rw-r--r-- 1 sc users  2044 Sep 17 16:25 CFSCV00014.DAT
-rw-r--r-- 1 sc users  2044 Sep 17 16:25 CFSCV00015.DAT
-rw-r--r-- 1 sc users  2044 Sep 17 16:26 CFSCV00016.DAT
root@]# ftp <hostname>
Connected to <hostname>
220 (vsFTPd 2.0.5)
530 Please login with USER and PASS.
530 Please login with USER and PASS.
KERBEROS_V4 rejected as an authentication type
Name (:root):
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> 
ftp> 
ftp> ls
227 Entering Passive Mode (192,168,50,10,141,170)
150 Here comes the directory listing.
-rw-r--r--    1 101      100          2044 Sep 17 08:18 CFSCV00001.DAT
-rw-r--r--    1 101      100          2044 Sep 17 08:19 CFSCV00002.DAT
-rw-r--r--    1 101      100          2044 Sep 17 08:19 CFSCV00003.DAT
-rw-r--r--    1 101      100          2044 Sep 17 08:20 CFSCV00004.DAT
-rw-r--r--    1 101      100          2044 Sep 17 08:20 CFSCV00005.DAT
-rw-r--r--    1 101      100          2044 Sep 17 08:21 CFSCV00006.DAT
-rw-r--r--    1 101      100          2044 Sep 17 08:21 CFSCV00007.DAT
-rw-r--r--    1 101      100          2044 Sep 17 08:22 CFSCV00008.DAT
-rw-r--r--    1 101      100          2044 Sep 17 08:22 CFSCV00009.DAT
-rw-r--r--    1 101      100          2044 Sep 17 08:23 CFSCV00010.DAT
-rw-r--r--    1 101      100          2044 Sep 17 08:23 CFSCV00011.DAT
-rw-r--r--    1 101      100          2044 Sep 17 08:24 CFSCV00012.DAT
-rw-r--r--    1 101      100          2044 Sep 17 08:24 CFSCV00013.DAT
-rw-r--r--    1 101      100          2044 Sep 17 08:25 CFSCV00014.DAT
-rw-r--r--    1 101      100          2044 Sep 17 08:25 CFSCV00015.DAT


Thanks

set this parameter in vsftpd.conf

per the man page.

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 
1 Like

Hi Frank,

Thank you, it works.!