-   Linux - Newbie (
-   -   time on our RH linux FTP server is four hours ahead, but desktop time is correct?? (

dgr 09-27-2007 07:52 AM

time on our RH linux FTP server is four hours ahead, but desktop time is correct??
we installed a new red had linux server a couple of months ago, and one service we have running on it is FTP, then from various desktops around the office people can use FTP software to go to the server and upload/download files.
A problem we've had with FTP is that the Modified/Created times on the files when you look at them from any desktop through FTP software is 4 hours ahead (and there's no time offset set in the FTP software). But if you look at the time on the desktop of the linux server it the correct time.
Does anyone know why this 4 hour time difference is occuring and how to correct it so it'll say the current/correct time?

thanks in advance,

colucix 09-27-2007 08:15 AM

Maybe, is time on the ftp server set to a different timezone? If this is the case, clients convert the timestamp of downloaded files to their local timezone. Anyway, it is a good practice to set time as UTC on file servers, so that clients can easily know when a file has been uploaded on the server itself.

dgr 09-27-2007 09:28 AM

Hello. I'm in the Eastern Time zone, the server's in the same building as I and my coworkers. I just looked at the Date/Time Properties and it's already set to the correct time zone, America/New_York Eastern Time. There's a check box in the window for System clock uses UTC and it's currently unchecked. Should I check that box? If I do, will that fix this FTP 4 hour time offset problem? And will it stay set to our EST time?

colucix 09-27-2007 10:27 AM

Hello, david. No, if you set UTC on the server now, it will be difficult to understand where the time lag comes from. Indeed, I guessed the time was already UTC on the server. Anyway, if you reside in EST timezone the offset from UTC is exactly 4-hours (at least during the daylight saving time) so there should be a similiar issue somewhere on the local network. Can you post simply the output of date from the server and from one of the desktops, if you don't mind?

dgr 09-27-2007 10:43 AM


I ran a terminal on the server typed date and it sayd
Thu Sep 27 11:39:54 EDT 2007

I then went through a terminal program on one of the desktops, got to a # sign, typed date and it gave the exact same time, just off by the several seconds it took me to get to the # sign.

No difference in time seen in the terminal windows, just the four hour offset when you use a ftp program to communicate with the server from a desktop.


colucix 09-27-2007 11:03 AM

Ok, I think this is an issue with the ls command which is performed from the FTP client when looking at remote files. Is the ftp running in a chroot area? Usually this comes out when there is no timezone info under the chroot environment. Maybe you can find some useful information in the documentation of the running ftp daemon. Which is it, anyway?

Edit: for example the following quote is from vsftpd.conf man page:

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

dgr 09-27-2007 01:12 PM

hello, thanks for the help you've given so far.
vsftpd is what's running as a service on our RH Linux server. What you were saying about turning on use_localtime makes sense to fix the 4-hour offset next question is where do I edit that setting so use_localtime is always on if the server has to reboot and can I turn it on while the service is currently running?

dgr 09-28-2007 07:24 AM

can anyone help me with this issue?
thanks in advance,

colucix 09-28-2007 07:45 AM

Hi david, here I am again. The default location for the vsftpd configuration file is

but some Red Hat versions put configuration file in

I'm not sure if it is necessary to let the changes take effect, but probably you have to restart the vsftpd daemon, as in

/sbin/service vsftpd restart

I_like_TUX 09-28-2007 12:37 PM

Not sure about which RH Linux you have, enterprise or Fedora? but for Fedora, the location of the configuration file is: /etc/vsftpd and is called vsftpd.conf

I would suggest (the following works for my Fedora 7):

1. backup your current working vsftpd.conf, like:
$ cp vsftpd.conf vsftpd.conf.old

2. add the line "use_localtime=YES" at the end of the vsftpd.conf file, a few additional comments will be great.

3. restart the service:
$ /etc/rc.d/init.d/vsftpd restart

4. login to ftp and see the time is now local time.

If you mess up, just rename vsftpd.conf.old back to vsftpd.conf and restart the service.

Acelduma 10-09-2007 05:42 AM

Are You Using NTP ?
If you are using Network Time Protocol (NTP) then your system clock is being
synchronized to a time standard that is providing time in UTC format.
In this case you should check the box in the window for System clock uses UTC.

Cheers, Ray.

All times are GMT -5. The time now is 03:37 PM.