{"id":31,"date":"2022-02-25T19:03:45","date_gmt":"2022-02-26T02:03:45","guid":{"rendered":"http:\/\/www.chuonthis.com\/tips\/2022\/02\/25\/suse-linux-ping-socket-permission-denied\/"},"modified":"2022-02-28T17:40:44","modified_gmt":"2022-03-01T00:40:44","slug":"suse-linux-ping-socket-permission-denied","status":"publish","type":"post","link":"https:\/\/chuonthis.com\/tips\/2022\/02\/25\/suse-linux-ping-socket-permission-denied\/","title":{"rendered":"SUSE Linux &#8211; ping socket: Permission denied"},"content":{"rendered":"<p>Performed an in-place upgrade of a SUSE Linux Enterprise Server machine from SUSE 10 to SUSE 11.  Afterwards, I noticed that I couldn&#8217;t use the ping command.  I get the message <code>socket: Permission denied<\/code>.  Checked the permissions on the ping executable and it looked okay.  Google didn&#8217;t seem to be coming up with anything useful, but I kept glancing over <a href=\"http:\/\/www.noobyard.com\/article\/p-atxxeapu-mx.html\">this Chinese blog post<\/a>.  I finally decided to run it through <a href=\"https:\/\/www-noobyard-com.translate.goog\/article\/p-atxxeapu-mx.html?_x_tr_sch=http&#038;_x_tr_sl=zh-CN&#038;_x_tr_tl=en&#038;_x_tr_hl=en&#038;_x_tr_pto=sc\">Google translate<\/a> and saw that it suggested that AppArmor was the culprit.  Sure enough, ran <code>rcapparmor stop<\/code> and I could ping again.<\/p>\n<p>Checking in <b>\/var\/log\/audit\/audit.log<\/b>, I saw entries like this:<br \/>\n<code>type=AVC msg=audit(1645839789.983:367): apparmor=\"DENIED\" operation=\"create\" profile=\"\/{usr\/,}bin\/ping\" pid=4499 comm=\"ping\" family=\"inet\" sock_type=\"dgram\" protocol=0<\/code><\/p>\n<p>That got me digging into files in <b>\/etc\/apparmor.d<\/b>.  The <b>bin.ping<\/b> file matched with one from a working system so I went to dig into the files that were being included at the top of the file:<\/p>\n<p><code>#include &lt;abstractions\/base&gt;<br \/>\n#include &lt;abstractions\/consoles&gt;<br \/>\n#include &lt;abstractions\/nameservice&gt;<\/code><\/p>\n<p>Doing a comparison of these files with a working system, I found that the non-working system had some lines missing in the <b>\/etc\/apparmor.d\/abstractions\/nameservice<\/b> file.  I added the lines below from a working file to the bottom of my non-working file, ran <code>rcapparmor restart<\/code>, and success!  Pings are working again.<\/p>\n<p><code># TCP\/UDP network access<br \/>\nnetwork inet  stream,<br \/>\nnetwork inet6 stream,<br \/>\nnetwork inet  dgram,<br \/>\nnetwork inet6 dgram,<\/code><\/p>\n<p>Another possible solution may be to run the <b>aa-complain<\/b>, <b>aa-logprof<\/b>, and <b>aa-enforce<\/b> commands as described in <a href=\"https:\/\/documentation.suse.com\/sles\/15-SP1\/html\/SLES-all\/cha-apparmor-support.html#sec-apparmor-support-trouble\">this SUSE support doc<\/a>.  I tried that and it didn&#8217;t seem to do anything.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Performed an in-place upgrade of a SUSE Linux Enterprise Server machine from SUSE 10 to SUSE 11. Afterwards, I noticed that I couldn&#8217;t use the ping command. I get the message socket: Permission denied. Checked the permissions on the ping executable and it looked okay. Google didn&#8217;t seem to be coming up with anything useful, but I kept glancing over&hellip; <a class=\"continue-reading-link\" href=\"https:\/\/chuonthis.com\/tips\/2022\/02\/25\/suse-linux-ping-socket-permission-denied\/\">Continue reading <span class=\"screen-reader-text\">SUSE Linux &#8211; ping socket: Permission denied<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-31","post","type-post","status-publish","format-standard","hentry","category-computers","entry"],"_links":{"self":[{"href":"https:\/\/chuonthis.com\/tips\/wp-json\/wp\/v2\/posts\/31","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chuonthis.com\/tips\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chuonthis.com\/tips\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chuonthis.com\/tips\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chuonthis.com\/tips\/wp-json\/wp\/v2\/comments?post=31"}],"version-history":[{"count":0,"href":"https:\/\/chuonthis.com\/tips\/wp-json\/wp\/v2\/posts\/31\/revisions"}],"wp:attachment":[{"href":"https:\/\/chuonthis.com\/tips\/wp-json\/wp\/v2\/media?parent=31"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chuonthis.com\/tips\/wp-json\/wp\/v2\/categories?post=31"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chuonthis.com\/tips\/wp-json\/wp\/v2\/tags?post=31"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}