From owner-freebsd-stable@FreeBSD.ORG Thu Feb 3 18:34:23 2005 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9CBC516A4CE for ; Thu, 3 Feb 2005 18:34:23 +0000 (GMT) Received: from lurza.secnetix.de (lurza.secnetix.de [83.120.8.8]) by mx1.FreeBSD.org (Postfix) with ESMTP id BAEC743D2D for ; Thu, 3 Feb 2005 18:34:22 +0000 (GMT) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (urahsr@localhost [127.0.0.1]) by lurza.secnetix.de (8.13.1/8.13.1) with ESMTP id j13IYKjN050719 for ; Thu, 3 Feb 2005 19:34:20 +0100 (CET) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.13.1/8.13.1/Submit) id j13IYKsl050718; Thu, 3 Feb 2005 19:34:20 +0100 (CET) (envelope-from olli) Date: Thu, 3 Feb 2005 19:34:20 +0100 (CET) Message-Id: <200502031834.j13IYKsl050718@lurza.secnetix.de> From: Oliver Fromme To: freebsd-stable@FreeBSD.ORG In-Reply-To: <200502031803.j13I3NZR016534@the-macgregors.org> X-Newsgroups: list.freebsd-stable User-Agent: tin/1.5.4-20000523 ("1959") (UNIX) (FreeBSD/4.11-RELEASE (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Subject: Re: Adjusting time on a secured FreeBSD machine. X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: freebsd-stable@FreeBSD.ORG List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Feb 2005 18:34:23 -0000 Rob MacGregor 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