• Contact
  • Contact Us
  • Disclamer
  • Home 1
  • Home 2
  • Home 3
  • Privacy Policy
Saturday, May 24, 2025
How VPS - How to use/setup VPS
  • Login
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
How VPS - How to use/setup VPS
No Result
View All Result
Home Operating System Linux

How to Stop and Disable Unwanted Services from Linux System

How VPS by How VPS
November 2, 2018
in Linux, Operating System
0
0
SHARES
67
VIEWS
Share on FacebookShare on Twitter

Contents

  1. Sample Output
  2. Sample Output
  3. 1. smbd and nmbd
  4. 2. Telnet
  5. 3. rlogin
  6. 4. rexec
  7. 5. FTP
  8. 6. automount
  9. 7. named
  10. 8. lpd
  11. 9. Inetd
  12. 10. portmap
  13. How to Kill a Process in Linux
  14. How to Disable a Services in Linux

We build a server according to our plan and requirements, but what are the intended functions while building a server to make it function quickly and efficiently. We all know that while installing a Linux OS, some unwanted Packages and Application gets installed automatically without the knowledge of a User.

How to Stop and Disable Unwanted Services from Linux System

Remove Unwanted Services From Linux

When building a server we need to ask ourselves what we actually need from the box. Do I need a Web Server or a FTP Server, a NFS Server or a DNS Server, a Database Server or something else.

Here in this article, we will be discussing some of these unwanted applications and services which you might not needed but they are installed by default during OS installation and unknowingly start eating your system resources.

Lets first know what kind of services are running on the system using the following commands.

[[email protected]]# ps ax
Sample Output
  PID TTY      STAT   TIME COMMAND
    2 ?        S      0:00 [kthreadd]
    3 ?        S      0:00  /_ [migration/0]
    4 ?        S      0:09  /_ [ksoftirqd/0]
    5 ?        S      0:00  /_ [migration/0]
    6 ?        S      0:24  /_ [watchdog/0]
    7 ?        S      2:20  /_ [events/0]
    8 ?        S      0:00  /_ [cgroup]
    9 ?        S      0:00  /_ [khelper]
   10 ?        S      0:00  /_ [netns]
   11 ?        S      0:00  /_ [async/mgr]
   12 ?        S      0:00  /_ [pm]
   13 ?        S      0:16  /_ [sync_supers]
   14 ?        S      0:15  /_ [bdi-default]
   15 ?        S      0:00  /_ [kintegrityd/0]
   16 ?        S      0:49  /_ [kblockd/0]
   17 ?        S      0:00  /_ [kacpid]
   18 ?        S      0:00  /_ [kacpi_notify]
   19 ?        S      0:00  /_ [kacpi_hotplug]
   20 ?        S      0:00  /_ [ata_aux]
   21 ?        S     58:46  /_ [ata_sff/0]
   22 ?        S      0:00  /_ [ksuspend_usbd]
   23 ?        S      0:00  /_ [khubd]
   24 ?        S      0:00  /_ [kseriod]
   .....

Now, let’s have a quick look at the processes accepting connection (ports) using the netstat command as shown below.

[[email protected]]# netstat -lp
Sample Output
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name   
tcp        0      0 *:31138                     *:*                         LISTEN      1485/rpc.statd      
tcp        0      0 *:mysql                     *:*                         LISTEN      1882/mysqld         
tcp        0      0 *:sunrpc                    *:*                         LISTEN      1276/rpcbind        
tcp        0      0 *:ndmp                      *:*                         LISTEN      2375/perl           
tcp        0      0 *:webcache                  *:*                         LISTEN      2312/monitorix-http 
tcp        0      0 *:ftp                       *:*                         LISTEN      2174/vsftpd         
tcp        0      0 *:ssh                       *:*                         LISTEN      1623/sshd           
tcp        0      0 localhost:ipp               *:*                         LISTEN      1511/cupsd          
tcp        0      0 localhost:smtp              *:*                         LISTEN      2189/sendmail       
tcp        0      0 *:cbt                       *:*                         LISTEN      2243/java           
tcp        0      0 *:websm                     *:*                         LISTEN      2243/java           
tcp        0      0 *:nrpe                      *:*                         LISTEN      1631/xinetd         
tcp        0      0 *:xmltec-xmlmail            *:*                         LISTEN      2243/java           
tcp        0      0 *:xmpp-client               *:*                         LISTEN      2243/java           
tcp        0      0 *:hpvirtgrp                 *:*                         LISTEN      2243/java           
tcp        0      0 *:5229                      *:*                         LISTEN      2243/java           
tcp        0      0 *:sunrpc                    *:*                         LISTEN      1276/rpcbind        
tcp        0      0 *:http                      *:*                         LISTEN      6439/httpd          
tcp        0      0 *:oracleas-https            *:*                         LISTEN      2243/java         
....

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:

1. smbd and nmbd

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.

2. Telnet

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.

3. rlogin

Do you need to log in to another host over network. If not! Kill this process and disable it from starting automatically at boot.

4. rexec

The Remote Process Execution aka rexec lets you execute shell commands on a remote computer. If you don’t require to execute shell command on a remote machine, simply kill the process.

5. FTP

Do you need to transfer files from one host to another host over Internet? If not you can safely stop the service.

6. automount

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.

7. named

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.

8. lpd

lpd is the printer daemon which makes it possible to print to that server. If you don’t need to print from the server chances are your system resources are being eaten up.

9. Inetd

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’t need inetd. better kill the process and disable it starting next time automatically.

10. portmap

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.

How to Kill a Process in Linux

In order to kill a running process in Linux, use the ‘Kill PID‘ command. But, before running Kill command, we must know the PID of the process. For example, here I want to find a PID of ‘cupsd‘ process.

[[email protected]]# ps ax | grep cupsd

1511 ?        Ss     0:00 cupsd -C /etc/cups/cupsd.conf

So, the PID of ‘cupsd‘ process is ‘1511‘. To kill that PID, run the following command.

[[email protected]]# kill -9 1511

To find out more about kill command with their examples, read the article A Guide to Kill Command to Terminate a Process in Linux

How to Disable a Services in Linux

In Red Hat based distributions such as Fedora and CentOS, make use of a script called ‘chkconfig‘ to enable and disable the running services in Linux.

For example, lets disable the Apache web server at the system startup.

[[email protected]]# chkconfig httpd off
[[email protected]]# chkconfig httpd --del

In Debian based distributions such as Ubuntu, Linux Mint and other Debian based distributions use a script called update-rc.d.

For example, to disable the Apache service at the system startup execute the following command. Here ‘-f’ option stands for force is mandatory.

[[email protected]]# update-rc.d -f apache2 remove

After making these changes, The system next time will boot without these UN-necessary process which in-fact will be saving our system resource and the server would be more practical, fast, safe and secure.

That’s all for now. I’ll here we again with another interesting article. Till then stay tuned and connected to Tecmint. Don’t forget to provide us with your valuable feedback in comment Section.

Source: tecmint.com

Tags: Linux Commandslinux guidelinux vps setup guide
Previous Post

30 Useful ‘ps Command’ Examples for Linux Process Monitoring

Next Post

Understanding Shared Libraries in Linux

Next Post

Understanding Shared Libraries in Linux

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

No Result
View All Result

Recent Post

Install Imagemagick on CentOS
CentOS

Install Imagemagick on CentOS

by How VPS
June 28, 2023
0

This is how I installed Imagemagick on a vanilla CentOS server Start off by installing the prerequisites yum install php-pear...

Read more
how to Check phpinfo

How to Check phpinfo of Hosting or VPS?

June 28, 2023
Failed to download metadata for repo 'appstream' on Centos 8

How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

February 25, 2022
How to Fix MySQL Error "Plugin 'InnoDB' registration as a STORAGE ENGINE failed"?

How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”?

November 17, 2020
How to optimize Mysql or MariaDB

How to optimize Mysql or MariaDB

November 3, 2020

Recent News

  • Install Imagemagick on CentOS
  • How to Check phpinfo of Hosting or VPS?
  • How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

Category

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel
  • About
  • Advertise
  • Careers
  • Contact

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
Thabet