JAUHARI

Everything Is POSSIBLE

How To: Set Date and Time On Linux

A few days ago I need to reconfigure office proxy server (I am using Squid) to avoid certain users accessing Internet during work hour. Sound extreme huh? But it’s a company policy. I can not deny.

They are not allowed to access during 08:00-12:00 and 13:00-16.30. After configuring and apply the ACL (Access Control List)  to my PC for trial, the ACL did not work. I ever did this before. I just did a copy and paste. It should work. Search result on the Internet to find the right configuration convinced me that mine was correct.

It must be caused by another problem, I guessed. It’s true. I did “touch test” and “ls-l” showed that the file was not created in the correct clock time. The “date” command told that the time on the server was not coorect.

I need to adjust server clock setting. Here is the command.

# date -s ‘MM/DD/YYYY HH:MM:SS’ <– change with actual date and time eg: ‘12/24/2007 16:25:00′

# clock -w  <– to set the hardware clock (CMOS)  to match the kernel time

# echo “clock -s” /sbin/hwclock  <– to make sure that the time is always correct on reboot, link the kernel time to hardware clock

# chmod +x /sbin/hwclock  <– make the script executable

Voila. The time is adjusted and my ACL worked like a charm.

Now, it’s time to wait for the complain :D

If you enjoyed this post, make sure you
Subscribe to my RSS feed!

2 Comments in 1 thread. Trackback URI

2007-12-27 18:41:28

Comment by ferdhie

MyAvatars 0.2

you could setup an NTP services for synchronizing ur proxy server clock with the time server and forget setting up your server clock.

2007-12-28 14:37:55

Comment by Arief Fajar Nursyamsu

MyAvatars 0.2

Mmm.. thanks for the tip. I’ll try it soon.
Thanks Bro..

 
 

Respond

Name (required)
E-mail (required - never shown publicly)
URI
Subscribe to comments via email
Your Comment (smaller size | larger size)

Smileys:
:) :( :d :"> :(( \:d/ :x 8-| /:) :o :-? :-" :-w ;) [-( :)>- more »

You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> in your comment.

Comments links could be nofollow free.



  • Archives

  • High Quality Free WordPress Themes
  • Earn $$ with WidgetBucks!
  • PayPal for Business
  • Your Ads Here