First, install:
[barlow@web01 ~]# yum -y install nfs-utils rpcbind
Second, permission description: NFS file system The permissions are mainly controlled by two parts: user UID and file /etc/exports, that is, when the UID of the client user exists in the client, directly use the UID of the server to the NFS system (root in some special cases) The following exceptions will be mentioned later). The /etc/exports file allows centralized control of NFS system permissions:
[barlow@web01 ~]#vim /etc/exports/home/public 192.168.8.0/24(ro) localhost(rw) * .ev.ncku.edu.tw(ro,sync)[share directory] [first host (permission)] [available host name] [available wildcard]
As for the host name setting, there are several Ways:
As for the permissions (that is, the parameters in the parentheses) Common parameters are:
Parameter value Description rw ro The permissions shared by this directory are readable and writable (read- Write) or read-only, but can eventually read or write, or related to the file system's rwx and identity. Sync async sync means that the data will be written to the memory and the hard disk synchronously. Async means that the data will be temporarily stored in the memory instead of being directly written to the hard disk! No_root_squash root_squash If the account of the NFS file system is root, how should the system determine the identity of this account? By default, the identity of the client root will be compressed to nfsnobody by the setting of root_squash, which will be more secure for the server system. But if you want to open the client to use the root identity to operate the server's file system, then you have to open no_root_squash! All_squash Regardless of the identity of the user who logged into NFS, his identity will be compressed into an anonymous user, usually nobody(nfsnobody)! Anonuid anongid anon means anonymous (anonymous) The UID setting of the anonymous user mentioned earlier by *_squash, usually nobody(nfsnobody), but you can set the value of this UID yourself! Of course, this UID must exist in your /etc/passwd! Anonuid refers to the UID and anongid is the group's GID.
Three, configuration: 1, preparation:
[barlow@web01 ~]# mkdir /home/public ##Create a directory for sharing [barlow@web01 ~]#chown Barlow /home/public ##Change the directory owner to barlow user[barlow@web01 ~]#service nfs start ##Start nfs service
2, Case 1: Let root keep the original root privileges < Br>
[barlow@web01 ~]# vim /etc/exports/home/public *(rw,no_root_squash)
# Anyone can use my /home/public to handle wildcards Host name, the focus is on no_root_squash
3, case two: the same directory, different host permissions are different
[barlow@web01 ~]# vim /etc/exports/home/public 192.168.8.0 /24(rw) *(ro)# Continue to accumulate later. Note that I divide the host and the domain into two segments (separated by spaces)
4, Case 3: Use for a single host
[barlow@web01 ~]# vim /etc/exports/home/public 192.168.100.10(rw)# Only 192.168.8.10 this host can access
I am here to shut down SELinux and firewall iptables Otherwise, there will be problems with NFS firewall configuration is particularly difficult, For connecting the port 111 and 2049 are fixed, the other will produce a lot of non-fixed port, there is no good way to achieve by iptables configuration. Fortunately, under RHEL/CentOS 6.x, there is a way to configure a fixed port, which is defined in /etc/sysconfig/nfs. There are many configuration files, but generally no adjustment is needed. Yes, as follows:
[barlow@web01 ~]# vim /etc/sysconfig/nfsRQUOTAD_PORT=1001LOCKD_TCPPORT=30001LOCKD_UDPPORT=30001MOUNTD_PORT=1002
Introduction to Soft InterruptsInsert processing that can be deferred from the hard interrupt handl
Linux kernel is very stable, but it is still inevitable to encounter a crash, get the memory image w
For beginners, the learning of Linux commands is not so simple. Many beginners rarely use commands o
One of the best things about Linux is that you can go deep into the operating system to explore how
Debian shows garbled (diamond, square) solution
Git and Github first use basic tutorials
Linux View Performance Command Introduction
Installing Arch Linux in my Defy
How to install varish as a cache and proxy
Three tips for improving the efficiency of Linux operation and maintenance management
Oracle, informix database environment variable settings and compile
Linux file copy, delete and move commands
Linux system troubleshooting log: Logrotate
Win10 how to backup Win10 computer system backup graphic tutorial
What should I do if the Windows 7 camera is blurry?
Win7 changes the system default installation directory after the program can not run the solution
Win7 often disables the solution of the network card
How to install the Chinese language pack for Windows 7
Windows server 2008 common problems and solutions
Windows 8 fast shutdown method and skills
Win8 UEFI mode installation ubuntu13.04 installation tutorial
About the addition and deletion of Microsoft Virtual WiFi Miniport Adapter