Linux NFS server Construction

Source: Internet
Author: User

Linux NFS server Construction
1. NFS: NFS (Network File System) is a Network File System Supported by FreeBSD. It allows computers in the Network to share resources through TCP/IP networks.
In NFS applications, local NFS client applications can transparently read and write files on the remote NFS server, just like accessing local files.
2. install the NFS server: sudoapt-get install nfs-kernel-server;
3. Configure/etc/exports: sudo vim/etc/exports;
The directory and permissions that Ubuntu NFS allows to mount are defined in the file/etc/exports.
Share the/home/student/xushan directory in the root directory,
Add the following line to the end of the/etc/exports file:/home/student/xushan * (rw, sync, no_root_squash)

*: Allows access from all network segments,

Rw: read/write permission,

Sync: synchronous data writing to memory and hard disk,

No_root_squash: the permission of the Ubuntu nfs client to share the directory user. If the client uses the root user, the client has the root permission for the shared directory.
4. Restart the NFS service.
$ Sudo/etc/init. d/portmap restart
$ Sudo/etc/init. d/nfs-kernel-server restart
5. Test Ubuntu NFS
Run the following command to display the shared directory: $ showmount-e
Alternatively, you can use the following command to mount it to a local disk, for example, Mount/home/student/xushan
To/mnt: $ sudo mount-t nfs 192.168.1.117:/home/student/xushan/mnt
Run the df command to check whether the mounting is successful.
(In this way, create a directory under the/mnt directory, and/home/student/xushan will also appear)
Run the following command to uninstall the instance: $ sudo umount/mnt
Note: When you run the uninstall command, first exit the mounted directory and then run the uninstall command. Otherwise, the device is busy and cannot be detached.

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.