Detailed steps to build an NFS file sharing server in Linux

Detailed steps to build an NFS file sharing server in Linux

Linux builds NFS server

In order to achieve data sharing among different operating systems, we usually build some servers for file sharing. NFS server is one of them, which realizes sharing between Linux and Linux. Today I will share the steps on how to build an nfs server on a linux system for your reference.

Build steps

1. Install the required software packages for nfs

yum install rpcbind nfs-utils

2. Create a test file and assign permissions

mkdir /home/test
chmod -R 777 /home/test/
cd /home/test/
vim aaa/bbb.txt

3. Modify the configuration file

vim /etc/exports
Write /home/test 192.168.121.0/24 (rw)   
The shared file path allows the shared network segment (shared file executable permissions)
The shared file executable permissions are:
      ro Read-only access rw Read-write access sync All data is written to the share on request hide Do not share subdirectories in the NFS shared directory no_hide Share subdirectories of the NFS directory all_squash UID and GID mapping of shared files to anonymous users anonymous, suitable for public directories.
      no_all_squash preserves the UID and GID of shared files (default)
      root_squash All requests of the root user are mapped to the same permissions as the anonymous user (default)
      no_root_squas The root user has full administrative access to the root directory

4. Start the service

systemctl start rpcbind nfs
Set the system to start automatically at boot echo "192.168.121.38:/home/test /nfs nfs4 defaults 0 0" >> /etc/fstab
 mount -av

5. View shared information

showmount -e 192.168.121.38 (the IP address here is the host address of the server)

6. Access the nfs server
Linux access:

mount 192.168.121.38:/home/test/ /mnt/
df

Summarize

This is the end of this article about how to build an NFS file sharing server in Linux. For more information about building an NFS server in Linux, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • How to implement one-click deployment of nfs in linux
  • Solutions for building ping and nfs in embedded Linux development environment
  • Linux NFS service security hardening method
  • Detailed explanation of NFS configuration tutorial under Linux
  • Analysis of Linux NFS server installation and configuration ideas
  • How to install and configure Linux NFS server (with pictures and text)
  • Linux NFS installation configuration and common problems, /etc/exports configuration file, showmount command
  • How to mount the nfs network file system between linux systems
  • Working principle and example analysis of Linux NFS mechanism

<<:  Four methods of using JS to determine data types

>>:  Detailed summary of mysql sql statements to create tables

Recommend

Understanding and application of JavaScript ES6 destructuring operator

Table of contents Preface The role of deconstruct...

Practice of deploying web applications written in Python with Docker

Table of contents 1. Install Docker 2. Write code...

Solve the problem of inconsistent front and back end ports of Vue

Vue front and back end ports are inconsistent In ...

MySQL 8.0.21 free installation version configuration method graphic tutorial

Six steps to install MySQL (only the installation...

How to run py files directly in linux

1. First create the file (cd to the directory whe...

Implementation steps for building FastDFS file server in Linux

Table of contents 1. Software Package 2. Install ...

OpenLayers realizes the method of aggregate display of point feature layers

Table of contents 1. Introduction 2. Aggregation ...

MySQL 8.0.11 installation and configuration method graphic tutorial (win10)

This article records the installation and configu...

A brief discussion on the performance issues of MySQL paging limit

MySQL paging queries are usually implemented thro...

js+canvas realizes code rain effect

This article shares the specific code of js+canva...

How to use jsx syntax correctly in vue

Table of contents Preface Virtual DOM What is Vir...

JavaScript to implement the back to top button

This article shares the specific code for JavaScr...

vue+ts realizes the effect of element mouse drag

This article example shares the specific code of ...