Where in the world is my server? Or how to change timezone on a Debian Lenny 5.0 computer

One of the most important functions a computer does is to keep time. For instance in a Windows AD environment if the Servers and client computers are more than 5 minutes askew then Kerberos authentication will fail. In other words they refuse to talk to each other. Try supporting that.

To ensure your computers are all on the same time use an NTP server to synchronise¬†against. That will keep all the computers on the same time and make your support team’s life happy. Exactly how to Setup an NTP daemon such as ntpd or the Windows time service will be the subject of another post.

So let’s assume your computer is nicely synchronising but you check the time and it’s out by 4 hours. What do you do? You might be tempted to manually change the time but if you did you’d soon find that the clock was 4 hours out again. Why? The Network Time Protocol will do it’s thing and fix it.

So what do you do? Most likely we are looking at a time zone issue. To check you timezone on a Debian Lenny 5.0 Linux system issue this command at your bash prompt: cat /etc/timezone. We used to use tzconfig to change the computer’s timezone. Now however we issue this command: dpkg-reconfigure tzdata. This will run you through a selection process.

When complete check /etc/timezone again, it will now be correct. At your bash prompt issue the command: date. The time will now show correctly.

Another nice command is tzselect. This will tell you the current time in any time zone around the world. Handy if your supporting clients outside of your time zone.

Share and Enjoy:
  • Print
  • Digg
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Twitter
  • Google Bookmarks

Leave a Reply

Your email address will not be published. Required fields are marked *

*