<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
> <channel><title>gHacks Technology News &#124; Latest Tech News, Software And Tutorials &#187; ntp</title> <atom:link href="http://www.ghacks.net/tag/ntp/feed/" rel="self" type="application/rss+xml" /><link>http://www.ghacks.net</link> <description>A technology news blog covering software, mobile phones, gadgets, security, the Internet and other relevant areas.</description> <lastBuildDate>Fri, 10 Feb 2012 13:29:21 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/> <item><title>Setting your computer time in Ubuntu</title><link>http://www.ghacks.net/2010/10/05/setting-your-computer-time-in-ubuntu/</link> <comments>http://www.ghacks.net/2010/10/05/setting-your-computer-time-in-ubuntu/#comments</comments> <pubDate>Tue, 05 Oct 2010 13:58:56 +0000</pubDate> <dc:creator>Jack Wallen</dc:creator> <category><![CDATA[Advice]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Open Source]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[Tutorials Basic]]></category> <category><![CDATA[date]]></category> <category><![CDATA[GNOME]]></category> <category><![CDATA[ntp]]></category> <category><![CDATA[time]]></category> <category><![CDATA[ubuntu]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=35576</guid> <description><![CDATA[You computer&#8217;s clock does more than just tell you the time. This clock also stamps your email with the correct time as well as documents and much more. So when your PC clock is off, your life is off (at least while you are working). So it is necessary to keep your machine time accurate. [...]]]></description> <content:encoded><![CDATA[<p>You computer&#8217;s clock does more than just tell you the time. This clock also stamps your email with the correct time as well as documents and much more. So when your PC clock is off, your life is off (at least while you are working). So it is necessary to keep your machine time accurate. But how do you do this? Besides making sure your hardware clock is correct (which is commonly done through the BIOS settings), you need to know how to set the time.</p><p>In this article I am going to show you how to change the time on your Ubuntu machine using both the GUI and the command line. Hopefully, when you&#8217;re done with this, your computer clock will always be accurate.</p><p><span
id="more-35576"></span><strong>Another option</strong></p><p>Of course there is always another option. You can always set up NTP on your machine. I have already covered this in my article &#8220;<a
title="Installing and configuring NTP on Linux" href="http://www.ghacks.net/2009/03/16/installing-and-configuring-ntp-on-linux/" target="_blank">Installing and configuring NTP on Linux</a>&#8220;. That is, by far, the most reliable way to manage your clock. But when you don&#8217;t have constant access to the internet, or you simply don&#8217;t want to install a daemon on your machine &#8211; you have to resort to other methods. Let&#8217;s take a look at them here.</p><p><strong>Command line</strong></p><p>In order to set the date from the command line, you use the <em>date</em> command. The date command, however, is not the simplest command to figure out &#8211; at least not from the man page. If you look at the man page for <em>date</em> you see the time format uses a specific time string format like:</p><p><em>MMDDhhmmYYYY.ss</em></p><p>What the above string means is:</p><p><em> </em></p><p><em> </em></p><p><em> </em></p><ul><li>MM<span
style="font-style: normal"> is a two digit month, between 01 to 12.</span></li><li>DD<span
style="font-style: normal"> is a two digit day, between 01 and 31. NOTE: Regular rules for days, according to month and year, apply.</span></li><li><span
style="font-style: normal"><em>hh</em> is two digit hour, using the 24-hour period so it is between 00 and 23.</span></li><li><span
style="font-style: normal"><em>mm</em> is two digit minute, between 00 and 59.</span></li><li>YYYY<span
style="font-style: normal"> is the year; it can be two digit or four digit: your choice. </span></li><li><span
style="font-style: normal"><em>ss</em> is two digit seconds. The period (&#8220;.&#8221;) before the ss is necessary.</span></li></ul><p>So, let&#8217;s say you want to set the correct date and time for this exact moment (the moment I am writing, not your reading). To do this I would enter the command:</p><p><code>sudo date 100507492010.00</code></p><p>at which point you would be returned:</p><p><code>Tue Oct 5 07:50:00 EDT 2010</code></p><p><strong>GUI</strong></p><div
id="attachment_35589" class="wp-caption alignleft" style="width: 310px"><a
href="http://www.ghacks.net/wp-content/uploads/2010/10/time_date_gui.png"><img
class="size-medium wp-image-35589 " src="http://www.ghacks.net/wp-content/uploads/2010/10/time_date_gui-500x294.png" alt="" width="300" height="176" /></a><p
class="wp-caption-text">Figure 1</p></div><p>Now, let&#8217;s take a look and see how this is done from the graphical front end. To do this click <strong>System &gt; Administration &gt; Time and Date</strong>. When you do this you will have to click the &#8220;lock&#8221; button to unlock this tool for changes. When you click this you will have to enter your sudo password. Upon proper authentication you will then be able to use the drop downs for hours, minutes, and seconds. When you change the time, you only need to close the tool, no saving required. NOTE: You can also change the date as well as the timezone with this same tool.</p><p><strong>Final thoughts</strong></p><p>Don&#8217;t be caught in the future or the past on Linux. Make sure your time is correct so you aren&#8217;t confusing those receiving your emails (unless you want them to think they are receiving emails from &#8220;future you&#8221;.)</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2010/10/05/setting-your-computer-time-in-ubuntu/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>Installing and Configuring NTP on Linux</title><link>http://www.ghacks.net/2009/03/16/installing-and-configuring-ntp-on-linux/</link> <comments>http://www.ghacks.net/2009/03/16/installing-and-configuring-ntp-on-linux/#comments</comments> <pubDate>Mon, 16 Mar 2009 14:07:04 +0000</pubDate> <dc:creator>Jack Wallen</dc:creator> <category><![CDATA[Advice]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Open Source]]></category> <category><![CDATA[Tutorials Basic]]></category> <category><![CDATA[clock]]></category> <category><![CDATA[Debian]]></category> <category><![CDATA[ntp]]></category> <category><![CDATA[ntp.org]]></category> <category><![CDATA[time]]></category> <category><![CDATA[time server]]></category> <guid
isPermaLink="false">http://www.ghacks.net/?p=11255</guid> <description><![CDATA[NTP is the Network Time Protocol. This protocol allows servers (or desktops) to communicate to very reliable sources to keep their time synchronized. There are two reasons why you would want to employ NTP: 1) You&#8217;re a geek and you want your time to be perfect. 2) You need your servers all synchronized with the [...]]]></description> <content:encoded><![CDATA[<p>NTP is the Network Time Protocol. This protocol allows servers (or desktops) to communicate to very reliable sources to keep their time synchronized. There are two reasons why you would want to employ NTP: 1) You&#8217;re a geek and you want your time to be perfect. 2) You need your servers all synchronized with the correct time.</p><p>Naturally the second reason is far more important than the first. But either way, you might very well be driven to keep your machine on the exact time. To that end you can either constantly monitor the time on your machine (manually changing it when necessary) or you can set up NTP to handle your time corrections for you.</p><p>Installing and configuring NTP is actually quite easy. It will, however, require the use of the command line. With that in mind, lets&#8217; get busy.</p><p><span
id="more-11255"></span><strong>Installing</strong></p><p>You could open up your Add/Remove Software utility, do a search for &#8220;ntp&#8221; (no quotes) and install the matching results. Or you can open up a terminal window and install ntp with one of the following commands (remember, you will need either root access or sudo):</p><ul><li><em>apt-get install ntp </em></li><li><em>yum install ntp<br
/> </em></li><li><em>urpmi ntp</em></li></ul><p>One of the above commands will install the ntp daemon and the configuration file <strong>/etc/ntp.conf</strong>.</p><p>Before you fire up the daemon you will need to take a look at the <strong>/etc/ntp.conf </strong>to make sure you have the ntp servers you want to use configured.</p><p><strong>Configuring</strong></p><p>Most likely your NTP installation will already have a configuration file that is ready to go. My Debian-based NTP install had such a .conf file. All I had to do was start the daemon. But you might have special needs or your install might not have been as complete.</p><p>The section of the <strong>ntp.conf</strong> that you will want to take a look at is the server section. Each line in this section is set up like so:</p><p><em>server IP_ADDRESS OPTION(S)</em></p><p>Where<em> IP_ADDRESS</em> is the actual address of the server you want to use and <em>OPTION(S)</em> is/are the option(s) you want to use.</p><p>There are two options that you might want to use for every server. These are:</p><p><strong>iburst</strong>: This option is used when the configured server is unreachable. When your machine can not contact its NTP server it will send out bursts of eight packets (instead of just one).</p><p><strong>dynamic</strong>: This option allows a server to be configured even if the server is not reachable during configuration. This option assumes that at some point the server will be reachable.</p><p>If you look at my <strong>/etc/ntp.conf</strong> file you will see the following in the server section:</p><p><code>server 0.debian.pool.ntp.org iburst dynamic<br
/> server 1.debian.pool.ntp.org iburst dynamic<br
/> server 2.debian.pool.ntp.org iburst dynamic<br
/> server 3.debian.pool.ntp.org iburst dynamic</code></p><p>If you are not sure what servers to use visit the official NTP organization <a
title="NTP.org" href="http://www.ntp.org" target="_blank">NTP.org</a> to find a list of trusted servers.</p><p><strong>Starting the Daemon</strong></p><p>Once you have everything up and running go back to the root terminal and issue the command:</p><p><em>/etc/init.d/ntp start</em></p><p>or</p><p><em>/etc/rc.d/init.d/ntp start</em></p><p>which will start the ntp daemon. NTP will now slowly start to adjust the time on your server. But don&#8217;t worry, it makes the adjustment slowly. First the daemon waits for at least ten packets of information before trusting a source.</p><p>Now test to make sure your installation is working by issuing the following command:</p><p><em>ntpq -p</em></p><p>which should give you a listing like:<br
/> <code>remote           refid      st t when poll reach   delay   offset  jitter =========================================================<br
/> +point2.adamants 64.202.112.75    2 u   44   64  377   75.955   -7.045   2.992<br
/> *station.mars.or 209.81.9.7       2 u   10   64  377   75.477   -1.144   0.977<br
/> -www.broadbandja 64.34.180.101    3 u   56   64  377   72.764    3.766   0.977<br
/> +pxe.lax-noc.com 209.81.9.7       2 u   25   64  377   65.686   -7.753   2.539</code></p><p>If you see zeros for the values you know ntp is not connecting. As you can see above my setup is connecting.</p><p><strong>Final thoughts</strong></p><p>NTP is an easy way to ensure your servers or your desktop is always using the correct time. In mission-critical machines, this can be quite important. Employing NTP will give you the security of knowing your machine&#8217;s right &#8220;on time&#8221;.</p> ]]></content:encoded> <wfw:commentRss>http://www.ghacks.net/2009/03/16/installing-and-configuring-ntp-on-linux/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> </channel> </rss>
