SuSE creates an NFS shared folder
Server Configuration:
1. Edit the NFS service configuration file
/software/suse11 *(rw,sync,no_root_squash,no_all_squash)
Note:
/Software/suse11 is the directory to be shared
* Indicates the IP address range that can be accessed. All IP addresses can be accessed here. Of course, you can also enter the machine name to replace it. Or 192.168.5.0/24 to specify the IP address range or
Machine name, which can contain wildcards.
No_all_squash retains the UID and gid of the shared file (default)
No_root_squash indicates that the root user has full management access permissions to the root directory.
The above configurations are classic and won't be verified directly during client access.
2. Start Related Services
/etc/init.d/nfsserver start
Note: nfsserver is the nfsd service in SuSE.
PS-A # Check whether nfsd process showmount-e # Check the existing shared directory
3. After the service is started, the configuration file is modified.
If you have modified the/etc/exports file, you do not need to restart the nfsserver service. Run
Exportfs-RV, # R indicates restart, V indicates display of export options
4. Open the firewall port:
TCP/UDP port: 111,2049,
UDP port: 6000,6001
Client Configuration:
1. Mount the NFS directory on the server
mount -t nfs 192.168.5.10:/pb/res /mnt
2. If you want to automatically mount a machine when it starts, you can add the above command to the startup script:
Modify/etc/init. d/after. Local
Add
mount -t nfs 192.168.5.10:/pb/res /mnt
Of course, you can also directly write the NFS directory to/etc/fstab. The disadvantage is that if the server is not started when the client is started, an error will occur.