{"id":6051,"date":"2014-03-09T10:29:01","date_gmt":"2014-03-09T14:29:01","guid":{"rendered":"http:\/\/g33kinfo.com\/info\/?p=6051"},"modified":"2014-03-09T10:29:01","modified_gmt":"2014-03-09T14:29:01","slug":"stop-and-disable-unwanted-services","status":"publish","type":"post","link":"https:\/\/g33kinfo.com\/info\/stop-and-disable-unwanted-services\/","title":{"rendered":"Stop and Disable Unwanted Services"},"content":{"rendered":"<p>Lets check to see what services are running on the system using the following commands.<\/p>\n<pre>[user@server]# ps ax<\/pre>\n<h5>Sample Output<\/h5>\n<p>&nbsp;<br \/>\n<!--more--><\/p>\n<pre>  PID TTY      STAT   TIME COMMAND\n    2 ?        S      0:00 [kthreadd]\n    3 ?        S      0:00  \\_ [migration\/0]\n    4 ?        S      0:09  \\_ [ksoftirqd\/0]\n    5 ?        S      0:00  \\_ [migration\/0]\n    6 ?        S      0:24  \\_ [watchdog\/0]\n    7 ?        S      2:20  \\_ [events\/0]\n    8 ?        S      0:00  \\_ [cgroup]\n    9 ?        S      0:00  \\_ [khelper]\n   10 ?        S      0:00  \\_ [netns]\n   11 ?        S      0:00  \\_ [async\/mgr]\n   12 ?        S      0:00  \\_ [pm]\n   13 ?        S      0:16  \\_ [sync_supers]\n   14 ?        S      0:15  \\_ [bdi-default]\n   15 ?        S      0:00  \\_ [kintegrityd\/0]\n   16 ?        S      0:49  \\_ [kblockd\/0]\n   17 ?        S      0:00  \\_ [kacpid]\n   18 ?        S      0:00  \\_ [kacpi_notify]\n   19 ?        S      0:00  \\_ [kacpi_hotplug]\n   20 ?        S      0:00  \\_ [ata_aux]\n   21 ?        S     58:46  \\_ [ata_sff\/0]\n   22 ?        S      0:00  \\_ [ksuspend_usbd]\n   23 ?        S      0:00  \\_ [khubd]\n   24 ?        S      0:00  \\_ [kseriod]\n   .....<\/pre>\n<p>Now, let\u2019s\u00a0 look at the processes accepting connection (ports) using the netstat command:<\/p>\n<pre>[user@server]# netstat -lp<\/pre>\n<h5>Sample Output<\/h5>\n<pre>Active Internet connections (only servers)\nProto Recv-Q Send-Q Local Address               Foreign Address             State       PID\/Program name   \ntcp        0      0 *:31138                     *:*                         LISTEN      1485\/rpc.statd      \ntcp        0      0 *:mysql                     *:*                         LISTEN      1882\/mysqld         \ntcp        0      0 *:sunrpc                    *:*                         LISTEN      1276\/rpcbind        \ntcp        0      0 *:ndmp                      *:*                         LISTEN      2375\/perl           \ntcp        0      0 *:webcache                  *:*                         LISTEN      2312\/monitorix-http \ntcp        0      0 *:ftp                       *:*                         LISTEN      2174\/vsftpd         \ntcp        0      0 *:ssh                       *:*                         LISTEN      1623\/sshd           \ntcp        0      0 localhost:ipp               *:*                         LISTEN      1511\/cupsd          \ntcp        0      0 localhost:smtp              *:*                         LISTEN      2189\/sendmail       \ntcp        0      0 *:cbt                       *:*                         LISTEN      2243\/java           \ntcp        0      0 *:websm                     *:*                         LISTEN      2243\/java           \ntcp        0      0 *:nrpe                      *:*                         LISTEN      1631\/xinetd         \ntcp        0      0 *:xmltec-xmlmail            *:*                         LISTEN      2243\/java           \ntcp        0      0 *:xmpp-client               *:*                         LISTEN      2243\/java           \ntcp        0      0 *:hpvirtgrp                 *:*                         LISTEN      2243\/java           \ntcp        0      0 *:5229                      *:*                         LISTEN      2243\/java           \ntcp        0      0 *:sunrpc                    *:*                         LISTEN      1276\/rpcbind        \ntcp        0      0 *:http                      *:*                         LISTEN      6439\/httpd          \ntcp        0      0 *:oracleas-https            *:*                         LISTEN      2243\/java         \n....<\/pre>\n<p>In the above output, you notice that some of the applications you may not needed on your server but they are still running as follows:<\/p>\n<h4>1. smbd and nmbd<\/h4>\n<p>smbd and nmbd are daemon of Samba Process. Do you really need to export smb share on windows or other machine. If not! why are these processes running? You can safely kill these processes and disable them from starting automatically when machine boots the next time.<\/p>\n<h4>2. Telnet<\/h4>\n<p>Do You need bidirectional interactive text-oriented communication over internet or local area network? If not! kill this process and turn-off it from starting at booting.<\/p>\n<h4>3. rlogin<\/h4>\n<p>Do you need to log in to another host over network. If not! Kill this process and disable it from starting automatically at boot.<\/p>\n<h4>4. rexec<\/h4>\n<p>The Remote Process Execution aka rexec lets you execute shell commands on a remote computer. If you don\u2019t require to execute shell command on a remote machine, simply kill the process.<\/p>\n<h4>5. FTP<\/h4>\n<p>Do you need to transfer files from one host to another host over Internet? If not you can safely stop the service.<\/p>\n<h4>6. automount<\/h4>\n<p>Do you need to mount different file systems automatically to bring up network file system? If not! Why is this process running? Why are you letting this application to use you resource? Kill the process and disable it from starting automatically.<\/p>\n<h4>7. named<\/h4>\n<p>Do you need to run NameServer (DNS)? If not what on earth is compelling you to run this process and allow eating up your resources. Kill the running process first and then turn-off it from running it at boot.<\/p>\n<h4>8. lpd<\/h4>\n<p>lpd is the printer daemon which makes it possible to print to that server. If you don\u2019t need to print from the server chances are your system resources are being eaten up.<\/p>\n<h4>9. Inetd<\/h4>\n<p>Are you running any inetd services? If you are running stand alone application like ssh which uses other stand alone application like Mysql, Apache, etc. then you don\u2019t need inetd. better kill the process and disable it starting next time automatically.<\/p>\n<h4>10. portmap<\/h4>\n<p>Portmap which is an Open Network Computing Remote Procedure Call (ONC RPC) and usages daemon rpc.portmap and rpcbind. If these Processes are running, means you are running NFS server. If NFS server is running unnoticed means your system resources are being used up un-necessarily.<\/p>\n<h3>How to Kill a Process in Linux<\/h3>\n<p>In order to kill a running process in Linux, use the \u2018<strong>Kill PID<\/strong>\u2018 command. But, before running Kill command, we must know the <strong>PID<\/strong> of the process. For example, here I want to find a PID of \u2018<strong>cupsd<\/strong>\u2018 process.<\/p>\n<pre>[user@server]# ps ax | grep cupsd\n\n1511 ?        Ss     0:00 cupsd -C \/etc\/cups\/cupsd.conf<\/pre>\n<p>So, the PID of \u2018<strong>cupsd<\/strong>\u2018 process is \u2018<strong>1511<\/strong>\u2018. To kill that PID, run the following command.<\/p>\n<pre>[user@server]# kill -9 1511<\/pre>\n<h3><\/h3>\n<h3>How to Disable a Service in Linux<\/h3>\n<p>In <strong>Red Hat<\/strong> based distributions such as <strong>Fedora<\/strong> and <strong>CentOS,<\/strong> we will use a script called \u2018chkconfig\u2018 to enable and disable the running services in Linux.<\/p>\n<p>For example, lets disable the Apache web server at the system startup.<\/p>\n<pre>[user@server]# chkconfig httpd off\n[user@server]# chkconfig httpd --del<\/pre>\n<p>In <strong>Debian<\/strong> based distributions such as <strong>Ubuntu<\/strong>, <strong>Linux Mint<\/strong> and other Debian based distributions, use a script called <strong>update-rc.d<\/strong>.<\/p>\n<p>For example, to disable the Apache service at the system startup execute the following command. Here \u2018<strong>-f\u2019<\/strong> option stands for force.<\/p>\n<pre>[user@server]# update-rc.d -f apache2 remove<\/pre>\n<p>After making these changes, The system next time will boot without these unnecessary processes.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Lets check to see what services are running on the system using the following commands. [user@server]# ps ax Sample Output &nbsp;&#8230; <\/p>\n<div class=\"read-more navbutton\"><a href=\"https:\/\/g33kinfo.com\/info\/stop-and-disable-unwanted-services\/\">Read More<i class=\"fa fa-angle-double-right\"><\/i><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-6051","post","type-post","status-publish","format-standard","hentry","category-info"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Stop and Disable Unwanted Services - Linux Shtuff<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/g33kinfo.com\/info\/stop-and-disable-unwanted-services\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Stop and Disable Unwanted Services - Linux Shtuff\" \/>\n<meta property=\"og:description\" content=\"Lets check to see what services are running on the system using the following commands. [user@server]# ps ax Sample Output &nbsp;... Read More\" \/>\n<meta property=\"og:url\" content=\"https:\/\/g33kinfo.com\/info\/stop-and-disable-unwanted-services\/\" \/>\n<meta property=\"og:site_name\" content=\"Linux Shtuff\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/fb.me\/g33kinf0\" \/>\n<meta property=\"article:author\" content=\"https:\/\/fb.me\/g33kinf0\" \/>\n<meta property=\"article:published_time\" content=\"2014-03-09T14:29:01+00:00\" \/>\n<meta name=\"author\" content=\"g33kadmin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/drsinger1111\" \/>\n<meta name=\"twitter:site\" content=\"@drsinger1111\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/stop-and-disable-unwanted-services\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/stop-and-disable-unwanted-services\\\/\"},\"author\":{\"name\":\"g33kadmin\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\"},\"headline\":\"Stop and Disable Unwanted Services\",\"datePublished\":\"2014-03-09T14:29:01+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/stop-and-disable-unwanted-services\\\/\"},\"wordCount\":586,\"publisher\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\"},\"articleSection\":[\"General Info\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/stop-and-disable-unwanted-services\\\/\",\"url\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/stop-and-disable-unwanted-services\\\/\",\"name\":\"Stop and Disable Unwanted Services - Linux Shtuff\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#website\"},\"datePublished\":\"2014-03-09T14:29:01+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/stop-and-disable-unwanted-services\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/g33kinfo.com\\\/info\\\/stop-and-disable-unwanted-services\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/stop-and-disable-unwanted-services\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Stop and Disable Unwanted Services\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#website\",\"url\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/\",\"name\":\"Linux Shtuff\",\"description\":\"Because I have CRS Syndrome...\",\"publisher\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\",\"name\":\"g33kadmin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\",\"url\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\",\"contentUrl\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\",\"width\":512,\"height\":512,\"caption\":\"g33kadmin\"},\"logo\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\"},\"description\":\"I am a g33k, Linux blogger, developer, student and Tech Writer for Liquidweb.com\\\/kb. My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....\",\"sameAs\":[\"https:\\\/\\\/thelinuxreport.com\",\"https:\\\/\\\/fb.me\\\/g33kinf0\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/drsinger1111\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Stop and Disable Unwanted Services - Linux Shtuff","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/g33kinfo.com\/info\/stop-and-disable-unwanted-services\/","og_locale":"en_US","og_type":"article","og_title":"Stop and Disable Unwanted Services - Linux Shtuff","og_description":"Lets check to see what services are running on the system using the following commands. [user@server]# ps ax Sample Output &nbsp;... Read More","og_url":"https:\/\/g33kinfo.com\/info\/stop-and-disable-unwanted-services\/","og_site_name":"Linux Shtuff","article_publisher":"https:\/\/fb.me\/g33kinf0","article_author":"https:\/\/fb.me\/g33kinf0","article_published_time":"2014-03-09T14:29:01+00:00","author":"g33kadmin","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/drsinger1111","twitter_site":"@drsinger1111","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/g33kinfo.com\/info\/stop-and-disable-unwanted-services\/#article","isPartOf":{"@id":"https:\/\/g33kinfo.com\/info\/stop-and-disable-unwanted-services\/"},"author":{"name":"g33kadmin","@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547"},"headline":"Stop and Disable Unwanted Services","datePublished":"2014-03-09T14:29:01+00:00","mainEntityOfPage":{"@id":"https:\/\/g33kinfo.com\/info\/stop-and-disable-unwanted-services\/"},"wordCount":586,"publisher":{"@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547"},"articleSection":["General Info"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/g33kinfo.com\/info\/stop-and-disable-unwanted-services\/","url":"https:\/\/g33kinfo.com\/info\/stop-and-disable-unwanted-services\/","name":"Stop and Disable Unwanted Services - Linux Shtuff","isPartOf":{"@id":"https:\/\/g33kinfo.com\/info\/#website"},"datePublished":"2014-03-09T14:29:01+00:00","breadcrumb":{"@id":"https:\/\/g33kinfo.com\/info\/stop-and-disable-unwanted-services\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/g33kinfo.com\/info\/stop-and-disable-unwanted-services\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/g33kinfo.com\/info\/stop-and-disable-unwanted-services\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/g33kinfo.com\/info\/"},{"@type":"ListItem","position":2,"name":"Stop and Disable Unwanted Services"}]},{"@type":"WebSite","@id":"https:\/\/g33kinfo.com\/info\/#website","url":"https:\/\/g33kinfo.com\/info\/","name":"Linux Shtuff","description":"Because I have CRS Syndrome...","publisher":{"@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/g33kinfo.com\/info\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547","name":"g33kadmin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif","url":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif","contentUrl":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif","width":512,"height":512,"caption":"g33kadmin"},"logo":{"@id":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif"},"description":"I am a g33k, Linux blogger, developer, student and Tech Writer for Liquidweb.com\/kb. My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....","sameAs":["https:\/\/thelinuxreport.com","https:\/\/fb.me\/g33kinf0","https:\/\/x.com\/https:\/\/twitter.com\/drsinger1111"]}]}},"_links":{"self":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/posts\/6051","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/comments?post=6051"}],"version-history":[{"count":0,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/posts\/6051\/revisions"}],"wp:attachment":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/media?parent=6051"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/categories?post=6051"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/tags?post=6051"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}