{"id":1328,"date":"2017-09-30T00:45:00","date_gmt":"2017-09-29T22:45:00","guid":{"rendered":"http:\/\/www.shukko.com\/x3\/?p=1328"},"modified":"2017-09-30T00:45:00","modified_gmt":"2017-09-29T22:45:00","slug":"to-find-out-which-user-and-which-process-is-making-connections-on-a-port","status":"publish","type":"post","link":"https:\/\/www.shukko.com\/x3\/2017\/09\/30\/to-find-out-which-user-and-which-process-is-making-connections-on-a-port\/","title":{"rendered":"to find out which user and which process is making connections on a port"},"content":{"rendered":"<pre class=\"lang:default decode:true \">lsof -i tcp:80 -P -R<\/pre>\n<p>This command shows us\u00a0<strong>all running processes<\/strong>\u00a0that are using port 80 for any kind of communication.<\/p>\n<ul>\n<li>The\u00a0<code>-i<\/code>\u00a0parameter specifies we want to list the processes,\u00a0<strong>by identifying them with IPv4 or IPv6<\/strong>.<\/li>\n<li>The\u00a0<code>tcp:80<\/code>\u00a0part means we only want to show TCP connections (and ignore UDP for the time being) using port 80.<\/li>\n<li>Using\u00a0<code>-P<\/code>\u00a0we specify we want to see the port numbers (80, 21, &#8230;) instead of the names (HTTP, FTP) which are shown by default. Much like the\u00a0<code>-n<\/code>\u00a0parameter with netstat.<\/li>\n<li>With\u00a0<code>-R<\/code>\u00a0we also show the\u00a0<strong>Parent Process ID<\/strong>, to see who initiated this process.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>lsof -i tcp:80 -P -R This command shows us\u00a0all running processes\u00a0that are using port 80 for any kind of communication. The\u00a0-i\u00a0parameter specifies we want to list the processes,\u00a0by identifying them with IPv4 or IPv6. The\u00a0tcp:80\u00a0part means we only want to show TCP connections (and ignore UDP for the time being) using port 80. Using\u00a0-P\u00a0we specify [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1328","post","type-post","status-publish","format-standard","hentry","category-kategerisiz"],"_links":{"self":[{"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/posts\/1328","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/comments?post=1328"}],"version-history":[{"count":1,"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/posts\/1328\/revisions"}],"predecessor-version":[{"id":1329,"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/posts\/1328\/revisions\/1329"}],"wp:attachment":[{"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/media?parent=1328"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/categories?post=1328"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shukko.com\/x3\/wp-json\/wp\/v2\/tags?post=1328"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}