How to set up an NFS server in a library

Source: Internet
Author: User
[Project case] an NFS server is set up in a library and the output directory is configured as follows (1) open the/nfs/share directory for all users to view the information. (2) open the/nfs/upload directory as the data upload Directory for the 192.168.1.0/24 network segment, and map all users and user groups to nfs-upload, the UID and GID are both 300. (3) share the/home/tom directory to the host 192.168.1.87, and only use

[Project case] A library sets up an NFS server and configures the output directory according to the following requirements:
(1) open the/nfs/share directory for all users to view their materials.
(2) open the/nfs/upload directory as the data upload Directory for the 192.168.1.0/24 network segment, and map all users and user groups to nfs-upload, the UID and GID are both 300.
(3) share the/home/tom directory with only the host 192.168.1.87, and only the user tom can access the directory completely.

[Configuration Implementation]
1) create a directory:/nfs/share,/nfs/upload,/home/tom
[Root @ server ~] # Useradd tom # create the user tom and the/home/tom Directory
2) modify the/nfs/upload directory permission and create a nfs ing user nfs-upload
3) Check whether NFS-utils and portmap are installed before configuring nfs)
As shown in, nfs-utils and portmap have been installed.
4) edit the nfs master configuration file
[Root @ server ~] # Vim/etc/exports
5) write test files to the three directories respectively.
[Root @ server ~] # Touch/nfs/share/sh
[Root @ server ~] # Touch/nfs/upload/up
[Root @ server ~] # Touch/home/tom/ho
6) start NFS-related services

------------------- Client ------------------
Showmoutn-e 192.168.1.87
Mkdir/share
Mkdir/upload
Mkdir/tom
Mount 192.168.1.87:/nfs/share
Mount 192.168.1.87:/nfs/upload
Mount 192.168.1.87:/home/tom
Df
Ls/share
Ls/upload
Ls/tom
Touch/share
Touch/upload
Touch/tom

Su-tom
Touch/tom

Su
Id tom
Useradd-u501 tom
Id tom

Su-tom
Touch/tom/tom2
Ls-l/upload/

Su
Touch/upload/root
Ls-l/upload/
---------------------------- Server -----------------------

Ls-l/nfs/upload/
Vim/etc/exports
/Nfs/share * (ro)
/Nfs/upload 192.168.1.0/24 (rw, anonuid = 300, anongid = 300)
/Home/tom 192.168.1.86 (rw)
Service portmap restart
Service nfslock restart
Service nfs restart
---------------------------- Client ---------------------
Mount-o remount/upload/
Touch/upload/root2
Su tom
Touch/upload/tom2
Ls-l/upload/
---------------------------- Server -----------------------
Cat/var/lib/nfs/etab

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.