Specifying access restrictions in /etc/exports
How to specify access restrictions
You specify access restrictions by using a text editor to modify the /etc/exports file. Access restrictions take effect only after you subsequently use the exportfs command.
Specifying the same restrictions for all hosts
For all hosts to mount read-write
To enable all hosts to mount the resource read-write, complete the following step.
Step
|
Action
|
|
1 |
In the /etc/exports file, enter the path name of the resource without any options.
Example
/vol/vol0/home
Result
All hosts can mount the /vol/vol0/home directory as read-write.
|
For all hosts to mount a resource read-only
To enable all hosts to mount the resource read-only, complete the following step.
Step
|
Action
|
|
1 |
In the /etc/exports file, enter the path name of the resource with the ro option.
Example
/vol/vol0/home -ro
Result
All hosts can mount the /vol/vol0/home directory as read-only.
|
Specifying different restrictions for different hosts
For specified hosts to mount read-write
To allow only certain hosts to mount the resource read-write and to prevent other hosts from mounting the resource, complete the following step.
Step
|
Action
|
|
1 |
In the /etc/exports file, enter the path name of the resource with the rw option.
Example
/vol/vol0/home -rw=host1:host2
Result
Host1 and host2 can mount the /vol/vol0/home directory as read-write. Other hosts cannot mount the /vol/vol0/home directory.
|
For specified hosts to mount read-only
To allow certain hosts to mount the resource read-only and prevent other hosts from mounting the resource, complete the following step.
Step
|
Action
|
|
1 |
In the /etc/exports file, enter the path name of the resource with the ro option.
Example
/vol/vol0/home -ro=host1:host2
Result
Host1 and host2 can mount the /vol/vol0/home directory as read-only. Other hosts cannot mount the /vol/vol0/home directory.
|
For specified hosts to mount read-write and all others to mount read-only
To enable certain hosts to mount a resource read-write and all other hosts to mount the resource read-only, complete the following step.
Step
|
Action
|
|
1 |
In the /etc/exports file, enter the path name of the resource with the ro and rw options.
Example
/vol/vol0/home -ro,rw=host1:host2
Result
Host1 and host2 can mount the /vol/vol0/home directory as read-write. All other hosts can mount the /vol/vol0/home directory as read-only.
|
For specified hosts to mount read-write and specified hosts to mount read-only
To allow certain hosts to mount a resource read-write and certain other hosts to mount the resource read-only, complete the following step.
Step
|
Action
|
|
1 |
In the /etc/exports file, enter the path name of the resource with the rw and rw options.
Example
/vol/vol0/home -ro=host2,rw=host1
Result
Host1 can mount the /vol/vol0/home directory as read-write. Host2 can mount the /vol/vol0/home directory as read-only. Other hosts cannot mount the /vol/vol0/home directory.
|
Copyright © 1994-2003, Network Appliance, Inc. All rights
reserved.
Part No. 210-00473
File: nfs5.htm
Last updated: 11/25/03 18:02:36