Operating System - HP-UX
1834827 Members
2155 Online
110070 Solutions
New Discussion

user ftp restricted & timezone METDST

 
Gabriele FACCHINI
Frequent Advisor

user ftp restricted & timezone METDST

Hi guys I have many restricted ftp user like this:
ftp_spe::xxx:yyy:FTP user:/app/a_spe/./.:/usr/bin/false
and after the change hour, appened sunday 28/03/2004 (2.00 became 3.00), this user don't see the correct creation/acces time of a files or dirs, es: if a file was created at 14.00 they see 13.00.
Can you help me?Thanks
Facchini Gabriele
Gabriele Facchini
14 REPLIES 14
Steven E. Protter
Exalted Contributor

Re: user ftp restricted & timezone METDST

I suppose if the user connected before the time zone switch and remained on after that, there could be a little confusion, possibly a bug somewehre.

I would think that disconnecting all users at time change and forcing a reconnect should solve this issue.

I would make sure my ftpd server is fully patched and my system is patched.

I would also consider connecting my server to a valid ntp time source so it stays on the correct time.

This looks like a bug or perhaps a file that was created during those few milliseconds the clock was switching times.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
john korterman
Honored Contributor

Re: user ftp restricted & timezone METDST

Hi,
is it only a problem for one single ftp user? If it is a problem for all the ftp users then I have a theory - if not, you might as well stop reading further...

But if it goes for all ftp users, the reason could be located somewhere else. An ftp user does not login as a normal user, hence no settings from startup files, e.g. .profile are read. An ftp user gets his TZ setting from the system default, etc/TIMEZONE. The reason why the ftp users' time on files differs from other users' could then be that the other users have their own TZ setting in their login sequence. It may sound far-fetched, but if you create a new user without any kind of TZ setting in the startup files, does he then see the same file stamps as the ftp users?

regards,
John K.
it would be nice if you always got a second chance
Gabriele FACCHINI
Frequent Advisor

Re: user ftp restricted & timezone METDST

Thanks for your replay.
This problem is common to all restricted ftp users. This user don't have a shell [/usr/bin/false] and the problem persist if the user close and reopen a new conection.
Perhaps this user during the autentication don't inherit the timezone.

Gabriele Facchini
Fabio Ettore
Honored Contributor

Re: user ftp restricted & timezone METDST

Ciao Gabriele,

what is the output of

# echo $TZ

?

It should be MET-1METDST.

If it is not then change it into /etc/TIMEZONE file.

HTH.

Best regards,
Ettore
WISH? IMPROVEMENT!
Gabriele FACCHINI
Frequent Advisor

Re: user ftp restricted & timezone METDST

Hi Ettore, on ftp session don't exist the command echo.
Thanks.
Gabriele Facchini
Fabio Ettore
Honored Contributor

Re: user ftp restricted & timezone METDST

Ciao di nuovo Gabriele,

if you login as root into system and launch

# echo $TZ

what does it obtain?
As John said ftp user should take TZ setting from system default. Then if system default has a wronged TIMEZONE it will reflect all users.
Just a thought...

Best regards,
Ettore

Best regards,
Ettore
WISH? IMPROVEMENT!
john korterman
Honored Contributor

Re: user ftp restricted & timezone METDST

Hi,
it sounds as if the ftp users use the /etc/TIMEZONE definition and other users do not. Try doing as Ettore suggests and then execute the date command.
Then execute the commands in /etc/TIMEZONES in the same shell. And then execute the date command again - my guess is that the date command will now show the same time as the ftp users see. Is that correct?

regards,
John K.
it would be nice if you always got a second chance
Gabriele FACCHINI
Frequent Advisor

Re: user ftp restricted & timezone METDST

Hi guys this the output of the command launched as root:
date
Thu Apr 1 08:34:31 METDST 2004
cat /etc/TIMEZONE
TZ=MET-1METDST
export TZ
echo $TZ
MET-1METDST
Gabriele Facchini
john korterman
Honored Contributor

Re: user ftp restricted & timezone METDST

Hi again,
it looks as if your "normal" users have some TZ setup in their .profile or elsewhere, hence the "METDST" in the posted date command.
I probably did not explain clearly enough the test I wanted you to perform, namely first login as a regular user, e.g. root, as you have done and then execute date.
Then try and execute the two commands in your /etc/TIMEZONE file, e.g.:
# TZ=MET-1METDST
# export TZ
and then again:
# date
which will probably display the time that yout ftpusers see (one hour earlier). If that is the case then the default setting is not correct. Do the two date commands show different results?

regards,
John K.
it would be nice if you always got a second chance
Elmar P. Kolkman
Honored Contributor

Re: user ftp restricted & timezone METDST

You could try adding a TIMEZONE file to the etc directory in the restricted ftp users, since the have a chrooted environment and thus cannot access the real /etc... I haven't tested this, but it sounds logical (at least to me).
Every problem has at least one solution. Only some solutions are harder to find.
Gabriele FACCHINI
Frequent Advisor

Re: user ftp restricted & timezone METDST

John users don't have any settings of timezone in .profile files.
I don't understand what test i can do for this restricted users.
Thanks
Gabriele Facchini
Gabriele FACCHINI
Frequent Advisor

Re: user ftp restricted & timezone METDST

Elmar I done what you suggest to me but it don't work, perhaps because this restricted ftp users have /usr/bin/false like shell....
Thanks
Gabriele
Gabriele Facchini
Fabio Ettore
Honored Contributor

Re: user ftp restricted & timezone METDST

Buongiorno Gabriele,

here the solution:

# cp /usr/lib/tztab /app/a_spe/usr/lib

It is needed to copy tztab in the home directory of ftp anonymous user.

I saw this into the following thread:

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

I had your same problem on a my system and I solved with the command above.

I hope this helps you too.

Ciao.
Ettore
WISH? IMPROVEMENT!
Gabriele FACCHINI
Frequent Advisor

Re: user ftp restricted & timezone METDST

thanks for your help.
Facchini Gabriele
Gabriele Facchini