How to build nfs service in ubuntu16.04

How to build nfs service in ubuntu16.04

Introduction to NFS

NFS (Network File System) is a network file system, which is one of the file systems supported by FreeBSD. It allows computers in the network to share resources through the TCP/IP network. In NFS applications, local NFS client applications can transparently read and write files located on the remote NFS server, just like accessing local files.

The nfs service is used to realize file sharing between Linux and Linux. The construction of the nfs service is relatively simple.

Now let's introduce how to build nfs service in Ubuntu 16.04 system. The construction of Ubuntu is even simpler than that of Red Hat.

How to configure NFS in Ubuntu

1. Install nfs service

sudo apt install nfs-common 

2. Modify the configuration file

sudo vim /etc/exports

The modifications are as follows:

/home *(rw,sync,no_root_squash) 

The meaning of each paragraph is as follows, which will be modified according to actual situation.

/home: shared directory*: specify which users can access* all users who can ping the host 192.168.1.* specify the network segment, users in this network segment can mount 192.168.1.12 only this user can mount (ro,sync,no_root_squash): permissions ro: read-only rw: read-write sync: synchronization no_root_squash: do not reduce the root user's permissions

Other options man 5 exports View

3. Restart nfs service

sudo /etc/init.d/nfs-kernel-server restart

At this point, the nfs service is set up.

Here's how the client accesses the server:

1. Check whether the client and server are connected (ping command)

ping + 主機IP

2. View the shared directory on the server

showmount -e + host IP
showmount -e 192.168.1.93
Export list for 192.168.1.93:
/home *

3. Mount the directory locally

mount 192.168.1.93:/home /mnt 

4. Access

By accessing the local mnt directory, you can access the directory shared by the server.

Summarize

The above is the full content of this article. I hope that the content of this article will have certain reference learning value for your study or work. Thank you for your support of 123WORDPRESS.COM. If you want to learn more about this, please check out the following links

You may also be interested in:
  • Detailed explanation of how to build an Ftp server on Ubuntu (success guaranteed)
  • How to decompile android apk in ubuntu environment
  • Detailed configuration of wireless network card under Ubuntu Server
  • VMware workstation 12 install Ubuntu 14.04 (64 bit)
  • VMware Workstation 14 Pro installation Ubuntu 16.04 tutorial
  • Solution to Ubuntu not being able to connect to the Internet
  • Solution to the problem that Ubuntu cannot connect to the Internet in the virtual machine
  • Ubuntu16.04 builds php5.6 web server environment
  • How to modify the time zone and time in Ubuntu system
  • Solution to no Chinese input method in Ubuntu

<<:  Analysis of different MySQL table sorting rules error

>>:  Introduction to Enterprise Production MySQL Optimization

Recommend

Layim in javascript to find friends and groups

Currently, layui officials have not provided the ...

Example of using Nginx reverse proxy to go-fastdfs

background go-fastdfs is a distributed file syste...

Solution to the problem that Docker cannot stop or delete container services

Preface Today, a developer gave me feedback that ...

Sharing experience on the priority of CSS style loading

During the project development yesterday, I encoun...

Example of converting JS one-dimensional array into three-dimensional array

Today I saw a friend asking a question in the Q&a...

Docker runs operations with specified memory

as follows: -m, --memory Memory limit, the format...

CSS3 realizes the animation effect of lotus blooming

Let’s look at the effect first: This effect looks...

Design theory: Why are we looking in the wrong place?

I took the bus to work a few days ago. Based on m...

Example of how to configure multiple virtual hosts in nginx

It is very convenient to configure virtual host v...

Use of hasOwnProperty method of js attribute object

Object's hasOwnProperty() method returns a Bo...

HTML Form Tag Tutorial (4):

Suppose now you want to add an item like this to ...

LinkedIn revamps to simplify website browsing

Business social networking site LinkedIn recently...

Detailed explanation of TypeScript 2.0 marked union types

Table of contents Constructing payment methods us...

Database backup in docker environment (postgresql, mysql) example code

Table of contents posgresql backup/restore mysql ...