nfs是比较不安全的生产不太建议用,如果真的要用的话不要对外
这次讲解如何修复nfs暴露的showmount漏洞
1、先查看你nfs的配置
cat /etc/exports
然后你在上面的IP进行showmount -e nfs服务器IP地址能看到上面这个配置
2、所以我们这里采取的办法是通过服务器器端的hosts.allow和hosts.deny两个文件限制
备份原有的hosts.allow和hosts.deny(备份是个好习惯)
cp /etc/hosts.allow /etc/hosts.allowbak
cp /etc/hosts.deny /etc/hosts.denybak
修改配置
vim /etc/hosts.allow
rpcbind: 192.168.131.1:allow #加入这行系统CENTOS6
vim /etc/hosts.deny
rpcbind:ALL:deny #加入这行系统CENTOS6
这里说下我的操作系统是centos6各版本配置如下:
修改添加 /etc/hosts.allow
mountd:192.168.13.111 #cent7.0设置方式
rpcbind: 192.168.13.1:allow #cent6.0设置方式
Portmap:192.168.13.1:allow #cent5.0设置方式
修改添加 /etc/hosts.deny
mountd:all #cent7.0设置方式
rpcbind:ALL:deny #cent6.0设置方式
Portmap