ubuntu 配置 nfs

本文详细介绍如何在 Ubuntu 系统上配置 NFS 服务,包括 portmap 的设置、hosts.allow 和 hosts.deny 文件的编辑、以及 /etc/exports 的配置等步骤。确保 NFS 服务能够正常启动并对外提供文件共享。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

ubuntu的NFS搭建

1)
配置portmap

$ sudo dpkg-reconfigure portmap , 对Should portmap be bound to the loopback address? 选N.

配置/etc/hosts.deny

### NFS DAEMONS

portmap:ALL

lockd:ALL

mountd:ALL

rquotad:ALL

statd:ALL

2)配置/etc/hosts.allow

### NFS DAEMONS

portmap: 192.168.1.

lockd: 192.168.2.1.

rquotad: 192.168.1.

mountd: 192.168.1.

statd: 192.168.2.1.

先全部禁止,在看hosts.allow 中允许那些主机mount到

$ sudo /etc/init.d/portmap restart 重启portmap daemon.

3)配置/etc/exports

/nfsshare 192.168.1.*(rw,sync,no_root_squash)

运行 $ sudo /etc/init.d/nfs-kernel-server restart 重启nfs服务
运行 $ showmount -e 查看

Export list for ubuntu:
/nfsshare 192.168.1.*
有这样的就对啦
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值