–备份
cp /etc/hosts.deny /etc/hosts.deny_bak20211123
cp /etc/hosts.allow /etc/hosts.allow_bak20211123
–拒绝所有挂载主机
echo “rpcbind:ALL:deny” >>/etc/hosts.deny
echo “mountd:all” >>/etc/hosts.deny
echo “Portmap:ALL:deny” >>/etc/hosts.deny
—此IP为目标挂载的主机 58.53.xx.xx,只允许此IP挂载过滤
echo “rpcbind:58.53.xx.xx:allow” >>/etc/hosts.allow
echo “mountd:58.53.xx.xx” >>/etc/hosts.allow
echo “Portmap:58.53.xx.xx:allow” >>/etc/hosts.allow"
注:修改后无需操作其它即可生效