Network File System (NFS) is a mechanism for attaching partitions (directories) on a remote host to a local system over the network. With support for network file systems, you can operate on the shared partition (directory) of the remote host on the local system just like operating on the local partition. File permissions in NFS: file system permissions. Shared permissions are used in linux to identify users not identified by user names but identified by UID. Other users except root can map to other hosts, root will not recognize
Network File System (NFS) is a mechanism for attaching partitions (directories) on remote hosts to local systems through the Network, with support for the network file system, you can operate on the shared partition (directory) of the remote host on the local system just like operating on the local partition.
File permissions in NFS: file system permissions, shared Permissions
In linux, user identification is not based on user names but on UID recognition.
Other users except root can map data to other hosts, which are not identified by root. The UID ing is performed on different hosts with the same UID.
NFS is an RPC-based service developed by SUN. remote procedure call
Nfs relies on rpc to provide services and obtain the immediate Port
Portmap provides the RPC service
Software Package: nfs-utils
Daemons process: nfsd, rpc. mountd identity verification rc. lockd implements file locking. The first user can write the file, and other users can only read rpc. statd rpc. quotad
Startup Script: nfs (nfsd, rpc. mountd, rpc. quotad)
Nfslock (rpc. lockd, rpc. statd)
Port: tcp2049 udp 2049
NFS configuration file:
Main configuration file:/etc/exports
Sub-configuration file:/etc/sysconfig/nfs can statically specify the port
Version: nfs1 uses NFS2 NFSv3 internally (currently used) NFSv4
NFS can only share directories.
Log on to the Linux server as root, edit the exports shared directory configuration file under the/etc directory, and specify the shared directory and permissions.
Run the following command to edit the file/etc/exports:
# Vi/etc/exports
Add the following content to the file:
/Home/work 192.168.0. * (rw, sync, no_root_squash)
Save and exit.
The added content indicates that the computer with the ip address range of 192.168.0. * can access the/home/work directory with the read/write permission.
/Home/work is also called the server output shared directory.
The meanings of parameters in parentheses are described as follows:
Rw: read/write permission. the read-only permission parameter is ro;
Sync: data is written to the memory and hard disk synchronously. You can also use async. Data is saved in the memory before being written to the hard disk immediately.
No_root_squash: attributes of the NFS server shared directory user. If the user is root, the shared directory has root permissions.
Run the following command to start port ing:
#/Etc/rc. d/init. d/portmap start
Finally, run the following command to start the NFS service. At this time, NFS will activate the daemon and then start listening to Client requests:
#/Etc/rc. d/init. d/NFS start
You can also restart the Linux server to automatically start the NFS service.
We will first perform a loop test on the NFS server on the Linux server. www.linuxidc.com/verify that the shared directory is accessible. Run the following command on a Linux Server:
# Mount-t NFS 192.168.0.20:/home/work/mnt
# Ls/mnt
Command to mount the NFS output shared directory of the Linux server to the/mnt directory. Therefore, if NFS works properly, you should be able to see the content in the/home/work shared directory in the/mnt directory.
Nfs remount
Exportfs-a all mount (unmount)/etc/exports settings
-R mounting
-U uninstall
-V display process