Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1553458
  • 博文数量: 239
  • 博客积分: 1760
  • 博客等级: 上尉
  • 技术积分: 1595
  • 用 户 组: 普通用户
  • 注册时间: 2011-01-08 23:53
文章分类

全部博文(239)

文章存档

2016年(1)

2015年(28)

2014年(53)

2013年(42)

2012年(50)

2011年(65)

分类: LINUX

2011-02-13 15:37:40

1、安装软件包
apt-get install nfs-kernel-server nfs-common portmap

2、配置NFS服务器
在/etc/exports中添加如下行
/ 192.168.0.5(rw,sync,no_root_squash)
"/"共享目录 "192.168.0.5"授权IP, "rw"可读写 "sync"同步 "no_root_squash"默认

给root权限

3、NFS客户端挂载共享目录
mount -t nfs -o nolock 192.168.0.3:/ /mnt/nfs
"192.168.0.3:/"挂载192.168.0.3 NFS服务器的/目录, 挂载在本机的/mnt/nfs目录

其他可能用到的资料
./etc/init.d/portmap  restart
./etc/init.d/nfs-common restart
./etc/init.d/nfs-kernel-server restart

配置
编辑/etc/default/portmap

配置/etc/hosts.deny
(禁止任何host(主机)能和你的NFS服务器进行NFS连接),加入:
### NFS DAEMONS
portmap:ALL
lockd:ALL
mountd:ALL
rquotad:ALL
statd:ALL

配 置/etc/hosts.allow
允许那些你想要的主机和你的NFS服务器建立连接。下列步骤将允许任何IP地址以

192.168.0开头的主机(连 接到NFS服务器上),也可以指定特定的IP地址。参看man

页 hosts_access(5), hosts_options(5)。加入:
### NFS DAEMONS
portmap: 192.168.0.
lockd: 192.168.0.
rquotad: 192.168.0.
mountd: 192.168.0.
statd: 192.168.10.

/etc/hosts.deny 和 /etc/hosts.allow 设置对portmap的访问. 采用这两个配置文件

有点类似"mask"的意思. 现在/etc/hosts.deny中禁止所有用户对portmap的访问. 再

在/etc/hosts.allow 中允许某些用户对portmap的访问.
阅读(1240) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~