How to disable rpc.bind(111) on server

Ok first of all here is some intro what rpc.bind is:
Provides information between Unix based systems. Port is often probed, it can be used to fingerprint the Nix OS, and to obtain information about available services. Port used with NFS, NIS, or any rpc-based service.

Basically if you have a server in Deutschland you must under there law disable this port or they will spam you to oblivion to block it.
So in order to disable it first check if its active. You can do this with this command:

netstat -tulnp | grep 111

if you get any response that shows this port this means it’s enabled. In order to disable it you must use the next set of commands:

systemctl stop rpcbind
systemctl stop rpcbind.socket
systemctl disable rpcbind
systemctl disable rpcbind.socket

This should be it after this use again command netstat mentioned above to check the status of the service.

3 Likes