HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

ftp server displays incorrect timestamp

 
John Carver
Frequent Advisor

ftp server displays incorrect timestamp

I have an HPUX11.23 box that displays the file timestamp incorrectly from a windows ftp client and a hpux ftp client. On the server itself the date command displays the correct date, the timezone appears to be set correctly, ntp is working fine but both ftp clients display the file timestamp exactly 7 hours ahead of the correct time. This appears to be related to the timezone, but how? My other hpux servers display the correct timestamps when the same ftp clients connect to them.
11 REPLIES
Tingli
Esteemed Contributor

Re: ftp server displays incorrect timestamp

I don't know the exact cause for this problem. But I guess that there might be something to do the permission for the time zone setting which is unreadable to ftp. Thus, it puts the time zone to GMT.
Steven Schweda
Honored Contributor

Re: ftp server displays incorrect timestamp

A Forum search for keywords like
ftp timezone
found many potentially useful things. One
example:

http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=138820

As usual, a more complete problem description
might help. Are you using anonymous FTP, or
FTP as some particular user(s)? (What
happens when you try the other one?)

Re: ftp server displays incorrect timestamp

I hope that "date -u" displays the right date too?
Tingli
Esteemed Contributor

Re: ftp server displays incorrect timestamp

Also, if the date result is different between root and common users, then more possible the permission issue.
Bill Hassell
Honored Contributor

Re: ftp server displays incorrect timestamp

> exactly 7 hours

Yep, the TZ variable is not been set for ftpd. The ftpd daemon is started by rc scripts so if ftpd is wrong, most everything in inetd.conf is probably using the wrong TZ value. There should be only ONE location to set the timezone: /etc/TIMEZONE. This file is read by all the rc startup scripts. You can't use your local login to porve the time is correct unless you bypass TZ and use date -u. Occasionally, misinformed sysadmins will set TZ manually in .profile.


Bill Hassell, sysadmin

Re: ftp server displays incorrect timestamp

>Bill: misinformed sysadmins will set TZ manually in .profile.

Did you mean /etc/profile?
Or did you mean they change that file and not /etc/TIMEZONE?
Bill Hassell
Honored Contributor

Re: ftp server displays incorrect timestamp

> Dennis: /etc/profile

Yes, manually setting TZ in /etc/profile or even setting it in the skeleton .profile, not knowing that there is a system-wide file to source a standard TZ value. For users in other timezones, a manual setting in .profile can be useful.


Bill Hassell, sysadmin

Re: ftp server displays incorrect timestamp

>Bill: For users in other timezones, a manual setting in .profile can be useful.

Thanks, I wanted to make sure this was said.
Steven Schweda
Honored Contributor

Re: ftp server displays incorrect timestamp

I haven't tried it, but I'd expect that one
could set a time zone for the FTP server by
specifying an appropriate wrapper script in
inetd.conf instead of the actual ftpd
program.
John Carver
Frequent Advisor

Re: ftp server displays incorrect timestamp

The /etc/profile entries appears correct:

# Set the TIMEZONE

if [ -r /etc/TIMEZONE ]
then
. /etc/TIMEZONE
else
TZ=MST7MDT # change this for local time.
export TZ
fi

/etc/TIMEZONE is readable by all. No TZ is set in the .profile.

What just occured to me is this server is using PROFTPD.





John Carver
Frequent Advisor

Re: ftp server displays incorrect timestamp

Did a little research and I've added the entry "TimesGMT off" to the /etc/proftpd.conf file. Now the timestamp is displayed in local time from the ftp client. Thanks all for the discussion.