How To Disable Portmapper service (port 111) on Linux

Portmapper service (RPCbind service) is a network service responsible for mapping RPC (Remote Procedure Call) program numbers to the IP addresses and transport protocol ports of the servers. This service is often used by clients in locating network services and by servers to advertise the availability of their services. It is typically used in conjunction with other RPC-based services, such as NFS (Network File System) and NIS (Network Information Service) and it runs on TCP and UDP port 111.

If Portmapper service is not secure and properly configured it can pose a security risk. Below are some of the potential security issues associated with the Portmapper service:

  • Information disclosure: The Portmapper service can be used by an attacker to gather information regarding network services on a system. This information can then be used to plan for an attack.
  • Unauthorized access: Without proper protection, this service can be accessed by unauthorized users who can then connect to other network services running on the system.
  • Amplification attacks: The RPCbind service is vulnerable to amplification attack. An attacker can use a spoofed IP address to send a request to the Portmapper service, causing it to respond to the spoofed IP address with a large amount of data, potentially causing a denial of service.
  • Unpatched vulnerability: Depending on the version there can be unpatched vulnerabilities present in the portmapper service which can be exploited by an attacker to gain unauthorized system access.

If you’re using Portmapper service in a production environment ensure it is well configured and protected to mitigate the risks associated with it. Some of the security measures will include:

  • Ensuring the system and services are up-to-date with the latest security patches
  • Configuration of the firewall rules to limit access to Portmapper service
  • Disabling the service if not required or used in your network

Checking RPC services on the system

The RPC information report can be checked using rpcinfo command on the system. The command will return a list of all the registered RPC services with rpcbind on host.

To display all registered RPC services on the system run the commands below:

$ rpcinfo -p
   program vers proto   port  service
    100000    4   tcp    111  portmapper
    100000    3   tcp    111  portmapper
    100000    2   tcp    111  portmapper
    100000    4   udp    111  portmapper
    100000    3   udp    111  portmapper
    100000    2   udp    111  portmapper

In the output you’ll get program numbers, versions, and protocol types. If host is not specified, the local host is the default.

If you want the information on a specific host, use the syntax rpcinfo -p [hostname], see example below:

$ rpcinfo -p 172.20.30.6
   program vers proto   port  service
    100000    4   tcp    111  portmapper
    100000    3   tcp    111  portmapper
    100000    2   tcp    111  portmapper
    100000    4   udp    111  portmapper
    100000    3   udp    111  portmapper
    100000    2   udp    111  portmapper

To send a ping request to the specified RPC service on the specified host and display the response, use:

rpcinfo -u [hostname] [program_number] [version_number]

Example:

$ rpcinfo -u 172.20.30.6 100000 4
program 100000 version 4 ready and waiting

Disable Portmapper service / RPCbind on Linux

It is good to mention that disabling or removing the Portmapper service may cause issues with other network services that depend on it for their functionality. Before you make the change, ensure you understand the implications of disabling it and that no services require it in the system.

If Portmapper service is not required on your system it can be disabled. But first check if rpcbind service is running:

$ systemctl status rpcbind
● rpcbind.service - RPC Bind
   Loaded: loaded (/usr/lib/systemd/system/rpcbind.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2025-01-25 16:48:18 EAT; 1 months 24 days ago
     Docs: man:rpcbind(8)
 Main PID: 987 (rpcbind)
    Tasks: 1 (limit: 407716)
   Memory: 1.8M
   CGroup: /system.slice/rpcbind.service
           └─987 /usr/bin/rpcbind -w -f

Jan 25 15:48:18 ubuntu-noble.cloudspinx.com systemd[1]: Starting RPC Bind...
Jan 25 15:48:18 ubuntu-noble.cloudspinx.com systemd[1]: Started RPC Bind.

If it’s in running state we can stop it.

sudo systemctl stop rpcbind rpcbind.socket

Also disable the service from starting automatically at boot time by running the following command in your terminal.

sudo systemctl disable rpcbind rpcbind.socket

Try executing rpcinfo to confirm the service is stopped.

$ rpcinfo
rpcinfo: can't contact rpcbind: RPC: Remote system error - Connection refused

Conclusion

As a System Administrator, it is highly recommended that you perform proper security of the Portmapper service to prevent any attacks on the system. If the service is not needed we highly recommend you disable it completely. We hope the information shared in this article was helpful to you.

More articles:

Your IT Journey Starts Here!

Ready to level up your IT skills? Our new eLearning platform is coming soon to help you master the latest technologies.

Be the first to know when we launch! Join our waitlist now.

Join our Linux and open source community. Subscribe to our newsletter for tips, tricks, and collaboration opportunities!

Recent Post

Leave a Comment

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

Related Post

Angular is among the most popular cross-platform frameworks but switching from AngularJS to Angular seems inevitable. But why should you […]

A memo is a written document that presents communication within a business or a personal circle, stating what is to […]

In this article we describe the process of configuring Containerd client to connect to a Sonatype Nexus container registry proxy/mirror. […]

Let's Connect

Unleash the full potential of your business with CloudSpinx. Our expert solutions specialists are standing by to answer your questions and tailor a plan that perfectly aligns with your unique needs.
You will get a response from our solutions specialist within 12 hours
We understand emergencies can be stressful. For immediate assistance, chat with us now

Contact CloudSpinx today!

Download CloudSpinx Profile

Discover the full spectrum of our expertise and services by downloading our detailed Company Profile. Simply enter your first name, last name, and email address.