|
楼主 |
发表于 2006-7-23 10:46:27
|
显示全部楼层
现在我把相关的配置文件和实验结果都贴出来
在同一台计算机172.16.95.101做实验:
服务器172.16.95.101
[root@localhost ~]# cat /etc/exports
#
/shared 172.16.95.0/255.255.255.0(ro,sync)
/var/ftp/RHEL4 *(ro,sync)
[root@localhost ~]#
[root@localhost ~]# mount -t nfs 172.16.95.101:/var/ftp/RHEL4 /mnt/nfstest
[root@localhost ~]# cd /mnt/nfstest/
[root@localhost nfstest]# touch a
touch: cannot touch `a': Permission denied
[root@localhost nfstest]#
[root@localhost nfstest]# cd
[root@localhost ~]# cat /etc/auto.master
#
# $Id: auto.master,v 1.3 2003/09/29 08:22:35 raven Exp $
#
# Sample auto.master file
# This is an automounter map and it has the following format
# key [ -mount-options-separated-by-comma ] location
# For details of the format look at autofs(5).
/misc /etc/auto.misc --timeout=60
#/misc /etc/auto.misc
#/net /etc/auto.net
[root@localhost ~]#
[root@localhost ~]# cat /etc/auto.misc
#
# $Id: auto.misc,v 1.2 2003/09/29 08:22:35 raven Exp $
#
# This is an automounter map and it has the following format
# key [ -mount-options-separated-by-comma ] location
# Details may be found in the autofs(5) manpage
cd -fstype=iso9660,ro,nosuid,nodev :/dev/cdrom
# the following entries are samples to pique your imagination
#linux -ro,soft,intr ftp.example.org:/pub/linux
#boot -fstype=ext2 :/dev/hda1
#floppy -fstype=auto :/dev/fd0
#floppy -fstype=ext2 :/dev/fd0
#e2floppy -fstype=ext2 :/dev/fd0
#jaz -fstype=ext2 :/dev/sdc1
#removable -fstype=ext2 :/dev/hdd
RHEL4 -ro,soft,intr 172.16.95.101:/vat/ftp/RHEL4
[root@localhost ~]#
[root@localhost ~]# cd /misc/RHEL4
[root@localhost RHEL4]# touch a
[root@localhost RHEL4]# ls a
a
[root@localhost RHEL4]#
也是通过nfs自动挂的root可以写入
下面在两台计算机做实验:
客户机172.16.95.221
[root@localhost ~]# showmount -e 172.16.95.101
Export list for 172.16.95.101:
/var/ftp/RHEL4 *
/shared 172.16.95.0/255.255.255.0
[root@localhost ~]# mount -t nfs 172.16.95.101:/var/ftp/RHEL4 /mnt/nfs
[root@localhost ~]# cd /mnt/nfs/
[root@localhost nfs]# touch a
touch: cannot touch `a': Permission denied
[root@localhost nfs]#
[root@localhost ~]# cat /etc/auto.master
#
# $Id: auto.master,v 1.3 2003/09/29 08:22:35 raven Exp $
#
# Sample auto.master file
# This is an automounter map and it has the following format
# key [ -mount-options-separated-by-comma ] location
# For details of the format look at autofs(5).
/misc /etc/auto.misc --timeout=60
#/misc /etc/auto.misc
#/net /etc/auto.net
[root@localhost ~]#
[root@localhost nfs]# cd /misc/RHEL4
[root@localhost RHEL4]# ls
RedHat
[root@localhost RHEL4]# touch a
touch: cannot touch `a': Permission denied
[root@localhost RHEL4]#
------------------
两台计算机就没有问题
两台计算机都是RHEL4 |
|