LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
Password
SUSE / openSUSE This Forum is for the discussion of Suse Linux.

Notices


Reply
  Search this Thread
Old 08-16-2008, 06:08 AM   #1
ionmich
Member
 
Registered: Sep 2003
Location: Mexico, Sweden
Distribution: openSUSE 15.2, Microware OS-9, MX-19, Bodhi 5.1.0
Posts: 256

Rep: Reputation: 41
Problem with ntpdate script


I have a problem with my hardware clock that I have been unable to resolve. As a work-around I can set the system time correctly if I start a console "su" to root and execute the simple script...

#! /bin/sh
/usr/sbin/ntpdate time.nist.gov

...but regardless of the many different ways I have tried to auto-run this script or to run it as user I always get the error...

ntpdate[3794]: bind() fails: Permission denied

...EVEN when I give the user full privileges on the script, and the executable. I believe that ntpdate might be trying to write to a log file for which the user has no write privelege. I have tried also using "ntpd", modified my /etc/ntp.conf and so on, all to no avail.

Any suggestions?
 
Old 08-16-2008, 09:34 AM   #2
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
Only root can update the system clock. Your script must be run as root, always. This is independent of the script's file permissions.
 
Old 08-16-2008, 03:49 PM   #3
estabroo
Senior Member
 
Registered: Jun 2008
Distribution: debian, ubuntu, sidux
Posts: 1,126
Blog Entries: 2

Rep: Reputation: 124Reputation: 124
The error that your seeing is because ntpdate by default uses a privileged port (123) and you have to effectively be root in order to open a privileged port, plus on top of that as Mr. C. said in order to update the system clock you have to be root.
 
Old 08-18-2008, 02:02 AM   #4
ionmich
Member
 
Registered: Sep 2003
Location: Mexico, Sweden
Distribution: openSUSE 15.2, Microware OS-9, MX-19, Bodhi 5.1.0
Posts: 256

Original Poster
Rep: Reputation: 41
Thank you for the concise responses. I can stop wasting time on fixes that won't work.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
NTPDATE didn't work - some firewall problem - Please help! biancap Linux - Networking 7 06-25-2008 09:37 AM
NTPDATE -vs- NTPd? carlosinfl Linux - Networking 3 02-25-2007 02:05 PM
ntpdate configuration? introuble Debian 5 03-26-2006 12:04 PM
ntpdate and port adcripps Linux - General 2 09-06-2002 04:38 AM
ntpdate installation. Oberon_sedai Linux - Newbie 1 12-06-2001 10:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

All times are GMT -5. The time now is 09:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration