<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Help! ntpq: write to localhost failed: Operation not permitted in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/help-ntpq-write-to-localhost-failed-operation-not-permitted/m-p/2949826#M89151</link>
    <description>All the while ntp and ntpq is working fine until I applied iptables rule. My iptables is shown in the attachment and ntpq will work if I take out the last two "Reject" lines.&lt;BR /&gt;</description>
    <pubDate>Sat, 12 Apr 2003 09:14:54 GMT</pubDate>
    <dc:creator>zhaogui</dc:creator>
    <dc:date>2003-04-12T09:14:54Z</dc:date>
    <item>
      <title>Help! ntpq: write to localhost failed: Operation not permitted</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-ntpq-write-to-localhost-failed-operation-not-permitted/m-p/2949822#M89147</link>
      <description>After I implemented iptables, I cannot run ntpq and got error as shown in the subject.&lt;BR /&gt;&lt;BR /&gt;But I have already opened port 123 for both ntp server and client as below,&lt;BR /&gt;&lt;BR /&gt;iptables -A INPUT -p udp -j ACCEPT -s $ntpserver -d $eth0IP --dport 123&lt;BR /&gt;iptables -A OUTPUT -p udp -j ACCEPT -d $ntpserver -s $eth0IP --sport 123&lt;BR /&gt;&lt;BR /&gt;iptables -A INPUT -p udp -j ACCEPT -s 127.0.0.1 -d $eth0IP --dport 123&lt;BR /&gt;iptables -A OUTPUT -p udp -j ACCEPT -d 127.0.0.1 -s $eth0IP --sport 123&lt;BR /&gt;&lt;BR /&gt;iptables -A INPUT -p udp -j ACCEPT -s $ntpclient -d $eth0IP --dport 123&lt;BR /&gt;iptables -A OUTPUT -p udp -j ACCEPT -d $ntpclient -s $eth0IP --sport 123&lt;BR /&gt;&lt;BR /&gt;Anybody can advise me on which port ntpq will use other than 123?  &lt;BR /&gt;&lt;BR /&gt;Thanks in advance,&lt;BR /&gt;</description>
      <pubDate>Sat, 12 Apr 2003 06:20:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-ntpq-write-to-localhost-failed-operation-not-permitted/m-p/2949822#M89147</guid>
      <dc:creator>zhaogui</dc:creator>
      <dc:date>2003-04-12T06:20:42Z</dc:date>
    </item>
    <item>
      <title>Re: Help! ntpq: write to localhost failed: Operation not permitted</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-ntpq-write-to-localhost-failed-operation-not-permitted/m-p/2949823#M89148</link>
      <description>hi &lt;BR /&gt;not sure if this helps. but just give a try.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;ntp seems to use port 123 only. but it has an entry in /etc/services for both tcp and udp. and your firewall rules is only for udp. try opening access for tcp as well and see if it helps.&lt;BR /&gt;++++++++++++&lt;BR /&gt;ntp             123/tcp&lt;BR /&gt;ntp             123/udp                         # Network Time Protocol&lt;BR /&gt;++++++++++++</description>
      <pubDate>Sat, 12 Apr 2003 07:16:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-ntpq-write-to-localhost-failed-operation-not-permitted/m-p/2949823#M89148</guid>
      <dc:creator>Balaji N</dc:creator>
      <dc:date>2003-04-12T07:16:00Z</dc:date>
    </item>
    <item>
      <title>Re: Help! ntpq: write to localhost failed: Operation not permitted</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-ntpq-write-to-localhost-failed-operation-not-permitted/m-p/2949824#M89149</link>
      <description>I am very sure we only use udp as I can see from below,&lt;BR /&gt;#netstat -a|grep ntp&lt;BR /&gt;udp        0      0 msmarketp2:ntp          *:*&lt;BR /&gt;udp        0      0 localhost:ntp           *:*&lt;BR /&gt;udp        0      0 *:ntp                   *:*&lt;BR /&gt;&lt;BR /&gt;By the way, xtnpd seems working fine as shown in /var/log/messages after restart, but only ntpq doesn't work.&lt;BR /&gt;Apr 12 10:59:51 msmarketp2 xntpd[30397]: xntpd exiting on signal 15&lt;BR /&gt;Apr 12 10:59:51 msmarketp2 xntpd: xntpd shutdown succeeded&lt;BR /&gt;Apr 12 10:59:51 msmarketp2 xntpd[11511]: xntpd 3-5.93e Tue Feb 11 12:23:23 SGT 2&lt;BR /&gt;003 (1)&lt;BR /&gt;Apr 12 10:59:51 msmarketp2 xntpd[11511]: tickadj = 5, tick = 10000, tvu_maxslew&lt;BR /&gt;= 495, est. hz = 100&lt;BR /&gt;Apr 12 10:59:51 msmarketp2 xntpd[11511]: precision = 7 usec&lt;BR /&gt;Apr 12 10:59:51 msmarketp2 xntpd[11511]: read drift of 189.963 from /etc/driftfi&lt;BR /&gt;le&lt;BR /&gt;Apr 12 10:59:51 msmarketp2 xntpd: xntpd startup succeeded&lt;BR /&gt;Apr 12 11:04:08 msmarketp2 xntpd[11511]: synchronized to 203.117.180.36, stratum&lt;BR /&gt;=1&lt;BR /&gt;&lt;BR /&gt;In fact I wrote a script to continuously run ntpq and at the same time I run lsof -p "pid of ntpq" and found out&lt;BR /&gt;that ntpq uses one of the following UDP ports&lt;BR /&gt;UDP *:51901&lt;BR /&gt;UDP *:51903&lt;BR /&gt;UDP *:65005&lt;BR /&gt;UDP *:65007&lt;BR /&gt;&lt;BR /&gt;Is that correct?&lt;BR /&gt;</description>
      <pubDate>Sat, 12 Apr 2003 07:37:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-ntpq-write-to-localhost-failed-operation-not-permitted/m-p/2949824#M89149</guid>
      <dc:creator>zhaogui</dc:creator>
      <dc:date>2003-04-12T07:37:34Z</dc:date>
    </item>
    <item>
      <title>Re: Help! ntpq: write to localhost failed: Operation not permitted</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-ntpq-write-to-localhost-failed-operation-not-permitted/m-p/2949825#M89150</link>
      <description>hey &lt;BR /&gt;&lt;BR /&gt;sorry. completely forget how i was configuring ntp long back. i remember it very faintly.&lt;BR /&gt;&lt;BR /&gt;first of all are u sure if it is a problem with your firewall. just try stoppping it and see if ntpq is running or is it reporting the same problem.&lt;BR /&gt;&lt;BR /&gt;or is that xntpd is running and u r running ntpq which is causing the problem.&lt;BR /&gt;&lt;BR /&gt;simply guessing and giving a shot.&lt;BR /&gt;-balaji</description>
      <pubDate>Sat, 12 Apr 2003 08:52:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-ntpq-write-to-localhost-failed-operation-not-permitted/m-p/2949825#M89150</guid>
      <dc:creator>Balaji N</dc:creator>
      <dc:date>2003-04-12T08:52:40Z</dc:date>
    </item>
    <item>
      <title>Re: Help! ntpq: write to localhost failed: Operation not permitted</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-ntpq-write-to-localhost-failed-operation-not-permitted/m-p/2949826#M89151</link>
      <description>All the while ntp and ntpq is working fine until I applied iptables rule. My iptables is shown in the attachment and ntpq will work if I take out the last two "Reject" lines.&lt;BR /&gt;</description>
      <pubDate>Sat, 12 Apr 2003 09:14:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-ntpq-write-to-localhost-failed-operation-not-permitted/m-p/2949826#M89151</guid>
      <dc:creator>zhaogui</dc:creator>
      <dc:date>2003-04-12T09:14:54Z</dc:date>
    </item>
    <item>
      <title>Re: Help! ntpq: write to localhost failed: Operation not permitted</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-ntpq-write-to-localhost-failed-operation-not-permitted/m-p/2949827#M89152</link>
      <description>btpq wants to open a connection to the ntpd daemon running on the local machine, hence the attempt to open a connection to localhost.&lt;BR /&gt;&lt;BR /&gt;Your configuration does not appear to allow connections from 127.0.0.1 to 127.0.0.1, so ntpq dies with the error you indicated.  Try adding &lt;BR /&gt;&lt;BR /&gt;iptables -A INPUT -p all -j ACCEPT -s 127.0.0.1 -d 127.0.0.1&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;This will allow processes on your machine to communicate via the loopback interface.</description>
      <pubDate>Sun, 13 Apr 2003 02:30:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-ntpq-write-to-localhost-failed-operation-not-permitted/m-p/2949827#M89152</guid>
      <dc:creator>Bill Douglass</dc:creator>
      <dc:date>2003-04-13T02:30:37Z</dc:date>
    </item>
    <item>
      <title>Re: Help! ntpq: write to localhost failed: Operation not permitted</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-ntpq-write-to-localhost-failed-operation-not-permitted/m-p/2949828#M89153</link>
      <description>Try addding:&lt;BR /&gt;iptables -A OUTPUT -p udp -m state --state NEW -m udp -i lo --sport 123 -o lo --dport 123 -j ACCEPT &lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Sergejs</description>
      <pubDate>Sun, 13 Apr 2003 04:50:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-ntpq-write-to-localhost-failed-operation-not-permitted/m-p/2949828#M89153</guid>
      <dc:creator>Sergejs Svitnevs</dc:creator>
      <dc:date>2003-04-13T04:50:52Z</dc:date>
    </item>
    <item>
      <title>Re: Help! ntpq: write to localhost failed: Operation not permitted</title>
      <link>https://community.hpe.com/t5/operating-system-linux/help-ntpq-write-to-localhost-failed-operation-not-permitted/m-p/2949829#M89154</link>
      <description>It still doesn't work after adding "iptables -A INPUT -p all -j ACCEPT -s 127.0.0.1 -d 127.0.0.1"&lt;BR /&gt;&lt;BR /&gt;By the way, Sergejs's commands got error "Can't use -i with OUTPUT".&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I tried to add in one more line "iptables -A OUTPUT -p all -j ACCEPT -s 127.0.0.1 -d 127.0.0.1",   now it WORKS!&lt;BR /&gt;&lt;BR /&gt;Thank you Bill Douglass&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 14 Apr 2003 00:02:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/help-ntpq-write-to-localhost-failed-operation-not-permitted/m-p/2949829#M89154</guid>
      <dc:creator>zhaogui</dc:creator>
      <dc:date>2003-04-14T00:02:02Z</dc:date>
    </item>
  </channel>
</rss>

