在ubuntu dapper上安装nfs服务器遇到问题,请大家帮助看看。
nfs server ip: 192.168.1.1
nfs client ip: 193.168.1.2
问题:
从本机测试nfs mount:
mount -t nfs -v localhost:/work /tmp/rt/
localhost:/work on /tmp/rt type nfs (rw,addr=127.0.0.1)
成功
umount /tmp/rt
mount -t nfs -v 192.168.1.1:/work /tmp/rt/
mount: 192.168.1.1:/work failed, reason given by server: Permission denied
失败
查看log:
tail -f /var/log/syslog
Aug 13 15:15:35 machine mountd[9176]: NFS mount of /work attempted from 127.0.0.1
Aug 13 15:15:35 machine mountd[9176]: /work has been mounted by 127.0.0.1
Aug 13 15:20:27 machine mountd[9176]: NFS mount of /work attempted from 192.168.1.1
Aug 13 15:20:27 machine mountd[9176]: Unauthorized access by NFS client 192.168.1.1.
Aug 13 15:20:27 machine mountd[9176]: Blocked attempt of 192.168.1.1 to mount /work
安装设置如下:
1. 下载安装nfs server
apt-get install nfs-user-server
apt-get install nfs-common
2. 设置共享目录
cat /etc/exports
/work 192.168.1.*(rw,no_root_squash,no_all_squash)
/work localhost(rw,no_root_squash,no_all_squash)
localhost一句是为了测试
3. 设置hosts.allow
cat /etc/hosts.allow
rpc.mountd : 192.168.1
rpc.nfsd : 192.168.1
rpc.mountd : 192.168.1. : allow
rpc.nfsd : 192.168.1. : allow
4. restart nfs
/etc/init.d/nfs-user-server restart
检查nfs共享
showmount -e
Export list for machine:
/work localhost
/work 192.168.1.*
nfs问题
-
- 帖子: 8
- 注册时间: 2006-08-02 12:41
换成nfs-kernel-server,问题消失了。
不知道nfs-kernel-server和nfs-user-server的区别是什么......
一篇参考文章:
https://help.ubuntu.com/community/SettingUpNFSHowTo
不知道nfs-kernel-server和nfs-user-server的区别是什么......
一篇参考文章:
https://help.ubuntu.com/community/SettingUpNFSHowTo