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

9 ways to show and hide CSS elements

In web page production, displaying and hiding ele...

CSS3 realizes bouncing ball animation

I usually like to visit the special pages or prod...

How to completely delete the MySQL service (clean the registry)

Preface When installing the executable file of a ...

HTML special character conversion table

character Decimal Character Number Entity Name --...

VMware virtual machine installation Apple Mac OS super detailed tutorial

Table of contents Summarize Sometimes we need to ...

Detailed use of Echarts in vue2 vue3

Table of contents 1. Installation 2. Use Echarts ...

MySQL 8.0.22 winx64 installation and configuration method graphic tutorial

The database installation tutorial of MySQL-8.0.2...

Let's talk about the issue of passing parameters to React onClick

Background In a list like the one below, clicking...

Share 8 MySQL pitfalls that you have to mention

MySQL is easy to install, fast and has rich funct...

CSS World--Code Practice: Image Alt Information Presentation

Using the <img> element with the default sr...

Detailed explanation of LVM seamless disk horizontal expansion based on Linux

environment name property CPU x5650 Memory 4G dis...

The functions and differences between disabled and readonly

1: readonly is to lock this control so that it can...