8.2. Securing the rpc.mountd service
The rpc.mountd daemon implements the server side of the NFS mount protocol. The NFS mount protocol is used by NFS version 3 (RFC 1813).
You can secure the rpc.mountd service by adding firewall rules to the server. You can restrict access to all networks and define specific exceptions by using firewall rules.
Prerequisites
-
The
rpc.mountdpackage is installed. -
The
firewalldpackage is installed and the service is running.
Procedure
Add firewall rules to the server, for example:
Accept
mountdconnections from the192.168.0.0/24host:# firewall-cmd --add-rich-rule 'rule family="ipv4" service name="mountd" source address="192.168.0.0/24" invert="True" drop'Accept
mountdconnections from the local host:# firewall-cmd --permanent --add-rich-rule 'rule family="ipv4" source address="127.0.0.1" service name="mountd" accept'To make the firewall settings permanent, use the
--permanentoption when adding firewall rules.
Reload the firewall to apply the new rules:
# firewall-cmd --reload
Verification
List the firewall rules:
# firewall-cmd --list-rich-rule rule family="ipv4" service name="mountd" source address="192.168.0.0/24" invert="True" drop rule family="ipv4" source address="127.0.0.1" service name="mountd" accept