Adjusting time on a secured FreeBSD machine.
Oliver Fromme
olli at lurza.secnetix.de
Thu Feb 3 10:34:23 PST 2005
Rob MacGregor <freebsd.macgregor at blueyonder.co.uk> wrote:
> Eli K. Breen wrote:
> > I'm not sure that this will cut it as it will days a very long time to
> > adjust to the proper time. Is there any way to speed this up?
>
> Not within NTPd itself. You could go with manually stepping the time in 1s
> intervals.
Adding to that, the following /bin/sh snippet should do
(untested!). You have to kill ntpd before.
STEP=100 # number of seconds to step forward
while [ $STEP -gt 0 ]; do
date -f %s $(( `date +%s` + 1 ))
sleep 1
STEP=$(( $STEP - 1 ))
done
It will take about 100 seconds to correct the clock forward
by another 100 seconds. If you need to correct backwards,
replace "+ 1" by "- 1". For different numbers of seconds
to correct, replace the 100 in the first line.
When you have approached the correct time sufficiently (i.e.
within a few seconds), restart ntpd with the -x option.
Best regards
Oliver
--
Oliver Fromme, secnetix GmbH & Co KG, Oettingenstr. 2, 80538 München
Any opinions expressed in this message may be personal to the author
and may not necessarily reflect the opinions of secnetix in any way.
"Documentation is like sex; when it's good, it's very, very good,
and when it's bad, it's better than nothing."
-- Dick Brandon
More information about the freebsd-stable
mailing list