Sunday, January 16, 2011

Linux NFS settings

NFSServer-set the NFSServer-setting, you first need to confirm that the Linux host can support NFS this service, and then set the consumer source IP or host name, and the sharing out of directory permissions.

So, how to use the shared ClientPC out directory? first to check whether a LinuxServer showmount can use NFS directory. If you have to mount it in the machine, so that you can use the resources provided by the NFSServer host. 1. system requirements in addition to the above mentioned two system daemon portmap and nfs-utils, the kernel (Kernel) version is better than the 2.2.18. In addition, if you recompile a kernel, be sure to select support for NFS. 2.etc/edit/etc/exports file exports: # vi/etc/exports/usr/src/sys-maproot = daemonost2/usr/ports-ro-network192.168.1.0 from above you can see in this example exports the file format, first define the file directory that you want to share, you must use an absolute path, not the symlink. Following is the directory to access-restricted parameter that is used to ensure security. The first line sets, will share out/usr/sys/src directory, but limits the client's root user is equivalent to the daemon user on my computer in order to avoid the client's root user owns the servers root powers for illegal actions; subsequent host2 parameter is the host name, this limits only host2 will share this/usr/sys/src directory; the third line sets the shared directory, but restricts/usr/ports to only allow read, and only the 192.168.1.0 network on your computer to access the shared directory. ◆ Rw rewritable. ◆ Ro for read-only permissions. ◆ The no_root_squash when visiting the NFS shared directory of the host use by users if you are root, then the user's permissions will be converted into anonymous users, usually its UID and GID becomes nobody. ◆ Root_squash login NFS hosts use the shared directory of the user, if you are root, then for the shared directory, it has root privileges. ◆ All_squash whether login NFS users status, its status will be converted into anonymous users, usually that is nobody. ◆ Anonuid usually nobody, of course, you can set the UID value, UID must exist in the/etc/passwd. ◆ Anongid with anonuid, but become groupID. ◆ Sync information synchronous writes to memory and hard disk. ◆ Async data will first staging to memory, rather than directly written to the hard disk. 3. activate service portmap and nsd #/etc/rc.d/init.d/portmapstart (or: # serviceportmapstart) #/etc/rc.d/init.d/nfsstart (or: # servicenfsstart) portmap is activated, a port number is 111 sunrpc service. As for nfs will activate at least two more system daemon and started listening needs, ClientPC cat/var/log/messages you can see whether or not the operation was successful: # cat/var/log/messages Nov1615: 04: 45caoportmap: portmapstartupsucceeded Nov1615: 04: 53caonfs: StartingNFSservices: succeeded Nov1615: 04: 54caonfs: rpc.rquotadstartupsucceeded Nov1615: 04: 54caonfs: rpc.mountdstartupsucceeded Nov1615: 04: 54caonfs: rpc.nfsdstartupsucceeded

No comments:

Post a Comment