Linux uses NFS for file sharing

Source: Internet
Author: User
Article Title: using NFS for file sharing in Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

In Linux, there are many tools for file sharing. However, NFS (Network File System) is undoubtedly the most successful one so far. By using the network file system, you can mount the shared directory on the file server to the local operating system through the network. In this way, you can operate on the shared directory of the remote server on the local operating system like operating on the local partition.

So what exactly can NFS achieve? So far, I have implemented at least two functions through the NFS Network File System. One is to build a file server for the enterprise, and the other is to deploy a Linux development and compilation platform.

Using the NFS Network File System, you can easily build a file sharing platform for enterprise users. For example, you only need to deploy a Linux server and configure the NFS file system. Then, create some shared folders on the server according to the department or other rules, and configure related permissions. For example, you can set a user and a shared folder for each department, and then allow each department to perform read/write operations on the folders of its own department. For folders in other departments, only the read permission is granted. Then, on the client, you can mount the shared folder of the server to the local host like a partition. If an enterprise employee needs to operate on shared files on the file server, it can be as easy as performing operations on local partitions. You can also configure the Startup File to enable the client to automatically mount the shared directory on the file server each time it is started. In addition, Microsoft's operating system also supports this NFS Network File System. Therefore, Microsoft's operating system can also mount NFS shared files by creating "Shortcuts. Therefore, using the NFS Network File System to share files is not restricted by the client. In addition, the system administrator does not have to set a home directory in each Linux operating system. The Home directory can be placed on the NFS server and is available everywhere on the network.

The NFS network file system can also be used to implement a cross-development compiling platform for Linux systems. During the development process embedded in the Linux operating system, the program developer must perform all software development work on the Linux development server. After the development is complete, perform cross-compilation and then download executable files to the embedded system using FTP. However, this method is less efficient and cannot be used for online debugging. Therefore, this Linux system development method is gradually being eliminated. Now, program developers can create an NFS Network File System to share specific partitions on the Linux server to the Embedded Target System to be debugged. In this case, the user can directly operate the shared directory of the Linux server on the embedded target system, and debug and modify the program online, greatly facilitating software development. Therefore, the NFS Network File System is an important part of the development of the embedded Linux operating system. With the help of the NFS file system, the development efficiency of the Linux operating system can be greatly improved.

However, to use the NFS Network File System, it takes some time for the Linux system administrator. When deploying an NFS Network File System, pay attention to the following issues.

  1. Be careful with the security risks caused by the NFS Network File System.

From the above description, we can see that the essence of the NFS Network File System is to share some directories on the server and then mount them to the client. That is to say, it is implemented based on the shared directory. However, as we all know, shared directories pose great security risks to servers. Therefore, if the administrator needs to share the directories on the server through NFS technology, for security reasons, the/etc/exports file on the server needs to be configured, restrict access to the shared file. For example, you are not allowed to have write permissions on the root directory, you do not need to use wildcards, and you cannot delete shared directories.

For example, it is the instance set in the exports file. In the preceding example, only clients with 192.168.0.5 can access the shared folder and only have read-only permission on the shared folder. In addition, the root_squash parameter indicates that the root directory cannot be written. The specific settings of this file will be explained in the following sections. The reason why I put this permission issue here is to explain it independently, that is, to attract everyone's attention to the security of the NFS network shared file system.

[1] [2] Next page

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.