ftp command shows different file modification time
Solution 1:
After 2 years, today I found out that the cause of the problem is because the FTP timestamps are set to GMT instead of following the correctly set timezone as highlighted in this URL
But in the URL, the change was done to the /etc/proftpd.conf
. This Linux server is using vsftpd. So there is a slight change to the solution.
Edit the vsftpd
configuration file and append this to it use_localtime=YES
. Then restart vsftpd
Here is a more detailed step I did:
- Logged in as a non-root user
su
toroot
Find which
ftpd
it is runnning. For this server it is usingvsftpd
$ ps -ef | grep ftpd
Make a copy of the configuration file.
Use an editor to edit the
vsftpd
configuration file.$ vim /etc/vsftpd/vsftpd.conf
Add the option
use_localtime
and set the value toYES
. The default value isNO
use_localtime=YES
Restart the ftpd service
$ /sbin/service vsftpd restart
$ /sbin/service vsftpd status
Retry login using ftp and check the file timestamp.
Solution 2:
I'm not positive about this, but perhaps is the timezone on your client set differently than on the server? That could cause your ftp client to display the time with an incorrect offset.