SlideShare a Scribd company logo
Network File System (NFS)
Introduction :
NFS allows a system to share directories and files with others over a
network. By using NFS, users and programs can access files on remote
systems almost as if they were local files.
Prerequisites :
we’ll use the following IP addresses as stand-ins for the host and client
values:
1. Host : 10.142.0.3
2. Client: 10.140.0.2
3. Private Network .
you should replace these values with your own host and client ip
addresses.
Step1-Installation:
At a terminal prompt enter the following command to install the NFS
Server:
On the Host:
Host$ sudo apt-get update
Host$ sudo apt-get install nfs-kernel-server
On the Client:
Client$ sudo apt-get update
Client$ sudo apt-get install nfs-common
Linux System AdministrationAbdullah Roomi:Student Name
NFSSubject:
21410051Student No:
amjad al husseini.MScTeacher:
Step2-Creating the Share Directories on the Host
We're going to share two separate directories, with different
configuration settings.
Host$: sudo mkdir /Server/Sharefile –p
Host$: sudo ls -la /Server/Sharefile
output:
Since we’re creating it with sudo, the directory is owned by
root here on the host.
drwxr-xr-x 2 root root 4096 Mar 4 18:12 .
NFS will translate any root operations on the client to the
nobody:nogroup credentials as a security measure. Therefore, we need
to change the directory ownership to match those credentials.
Host$ sudo chown nobody:nogroup /Server/Sharefile
Host$ ls -la /Server/Sharefile
Output:
drwxr-xr-x 2 nobody nogroup 4096 Mar 4 18:12 .
This directory is now ready for export.
Step 3 — Configuring the NFS Exports on the Host Server
Next, we’ll dive into the NFS configuration file to set up the sharing of
these resources.
Open the /etc/exports file in your text editor with root privileges:
Host$ sudo nano /etc/exports
The file has comments showing the general structure of each
configuration line. The syntax is basically:
/Server/Sharefile 10.140.0.2 (rw,sync,no_subtree_check)
Let’s take a look at what each one means.
1. rw: This option gives the client computer both read and write
access to the volume.
2. sync: This option forces NFS to write changes to disk before
replying. This results in a more stable and consistent environment
since the reply reflects the actual state of the remote volume.
However, it also reduces the speed of file operations.
3. no_subtree_check: This option prevents subtree checking, which
is a process where the host must check whether the file is actually
still available in the exported tree for every request. This can
cause many problems when a file is renamed while the client has
it opened. In almost all cases, it is better to disable subtree
checking.
When you are finished making your changes, save and close the file.
Then, to make the shares available to the clients that you configured,
restart the NFS server with the following command:
Host$ sudo systemctl restart nfs-kernel-server
Step 4 — Adjusting the Firewall on the Host
First, let’s check the firewall status to see if it’s enabled and if so, to see
what's currently permitted
Host$ sudo ufw status
Output:
Status: active
Use the following command to open port 2049 on the host, being sure
to substitute your client's ip address:
Host$ sudo ufw allow from 10.140.0.2 to any port nfs
You can verify the change by typing:
Host$ sudo ufw status
Output:
Status: active
To Action From
-- --- ---
OpenSSH ALLOW Anywhere
2049 ALLOW 10.140.0.2
This confirms that UFW will only allow NFS traffic on port 2049 from our
client machine.
Step 5 — Creating the Mount Points on the Client
Now that the host server is configured and serving its shares, we’ll
prepare our client.
In order to make the remote shares available on the client, we need to
mount the host directory on an empty client directory.
We’ll create directory for our mounts:
Client$ sudo mkdir /Client/Sharefile -p
Step 6 — Mounting the Directories on the Client
Client$ sudo mount 10.142.0.3:/Server/Sharefile /Client/Sharefile
You can double-check that they mounted successfully in several ways
1. df –h
2. mount
3. findmnt
client@instance-6:~$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 1.8G 0 1.8G 0% /dev
tmpfs 370M 5.2M 365M 2% /run
/dev/sda1 9.7G 1.3G 8.4G 13% /
tmpfs 1.9G 0 1.9G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup
tmpfs 370M 0 370M 0% /run/user/1001
10.142.0.3:/Server/Sharefile 9.7G 1.3G 8.4G 13% /Client/Sharefile
Step 7 — Testing NFS Access
Next, let’s test access to the shares by writing something to each of
them.
Client$ sudo touch /Client/Sharefile/test.txt
Client$ sudo nano test.txt
Welcome in test.txt
Output:
Welcome in test.txt
Then, check its ownership:
Client$ ls -la /Client/Sharefile
Output:
drwxr-xr-x 2 nobody nogroup 4096 Mar 4 18:12 .
Step 8 — Mounting the Remote NFS Directories at Boot
We can mount the remote NFS shares automatically at boot by adding
them to /etc/fstab file on the client.
Open this file with root privileges in your text editor:
Client$ sudo nano /etc/fstab
10.142.0.3:/Server/Sharefile /Client/Sharefile nfs
auto,nofail,noatime,nolock,intr,tcp,actimeo=1800 0 0
Step 9 — Unmounting an NFS Remote Share
Client$ sudo umount /Client/Sharefile
Client$ df -h
1
References
1
https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nfs-mount-on-ubuntu-16-04

More Related Content

PPTX
Linux commands
PPTX
Linux network file system (nfs)
PDF
Linux Training For Beginners | Linux Administration Tutorial | Introduction T...
PPTX
Compiling linux kernel and submit first patch
PPT
Basic 50 linus command
PPT
Linux Commands
PPTX
Linux System Administration - NFS Server
PPT
Apache1.ppt
Linux commands
Linux network file system (nfs)
Linux Training For Beginners | Linux Administration Tutorial | Introduction T...
Compiling linux kernel and submit first patch
Basic 50 linus command
Linux Commands
Linux System Administration - NFS Server
Apache1.ppt

What's hot (20)

KEY
Linux beginner's Workshop
PPT
Solaris 10 administration 2 Configuring NFS
PPTX
Samba power point presentation
PDF
Samba
PPS
Linux06 nfs
PDF
AFS case study
PPT
Basic command ppt
PDF
Top 10 Random Linux/Ubuntu Commands
PPTX
PPTX
SUN Network File system - Design, Implementation and Experience
PDF
linux-commandline-magic-Joomla-World-Conference-2014
PPTX
Network file system (nfs)
PDF
Modul server debian 5
PPT
Samba server
PDF
LINUX Admin Quick Reference
DOC
Modul quick debserver
PPT
Nf Sp4
PPTX
Docker Workshop
PPT
Presentation on samba server & apache server
PPTX
Linux basic commands
Linux beginner's Workshop
Solaris 10 administration 2 Configuring NFS
Samba power point presentation
Samba
Linux06 nfs
AFS case study
Basic command ppt
Top 10 Random Linux/Ubuntu Commands
SUN Network File system - Design, Implementation and Experience
linux-commandline-magic-Joomla-World-Conference-2014
Network file system (nfs)
Modul server debian 5
Samba server
LINUX Admin Quick Reference
Modul quick debserver
Nf Sp4
Docker Workshop
Presentation on samba server & apache server
Linux basic commands
Ad

Similar to Network File System (NFS) (20)

PDF
How to Install NFS Server and Client on Ubuntu 2404.pdf
PPTX
NFS is an excellent way of sharing files between linux and other unix systems
PPTX
Network File System
PDF
PPT
Server configuration
PDF
Access Network Attached Storage in RHEL - RHCSA (RH134).pdf
ODP
NFS ubuntu Server and windows 7 Client
PDF
sharing-filesystems-using-nfs-slides.pdf
PPT
NFS.ppt
PPT
PDF
NFS(Network File System)
PPT
NFS.ppt shshsjsjsjssjsjsksksksksksisisisisi
PDF
file-storage-100.pdf
PPT
Distributed File Systems
PPTX
Ibm spectrum scale fundamentals workshop for americas part 5 spectrum scale_c...
PPT
Dfs (Distributed computing)
ODP
testing-nfs
PPTX
Sun NFS , Case study
DOCX
lec5+.docx
How to Install NFS Server and Client on Ubuntu 2404.pdf
NFS is an excellent way of sharing files between linux and other unix systems
Network File System
Server configuration
Access Network Attached Storage in RHEL - RHCSA (RH134).pdf
NFS ubuntu Server and windows 7 Client
sharing-filesystems-using-nfs-slides.pdf
NFS.ppt
NFS(Network File System)
NFS.ppt shshsjsjsjssjsjsksksksksksisisisisi
file-storage-100.pdf
Distributed File Systems
Ibm spectrum scale fundamentals workshop for americas part 5 spectrum scale_c...
Dfs (Distributed computing)
testing-nfs
Sun NFS , Case study
lec5+.docx
Ad

More from abdullah roomi (10)

PPTX
PPTX
PPTX
Emulation-based SW protection
PDF
RSS Application Using Dom
PPTX
Security in Windows operating system
DOCX
Wireless Sensor Networks
PPTX
Mobile Forensics
PPTX
Nginx as a Revers Proxy for Apache on Ubuntu
PPTX
it project
Emulation-based SW protection
RSS Application Using Dom
Security in Windows operating system
Wireless Sensor Networks
Mobile Forensics
Nginx as a Revers Proxy for Apache on Ubuntu
it project

Recently uploaded (20)

PDF
Encapsulation theory and applications.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
sap open course for s4hana steps from ECC to s4
PPTX
Spectroscopy.pptx food analysis technology
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Empathic Computing: Creating Shared Understanding
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Cloud computing and distributed systems.
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Encapsulation theory and applications.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
NewMind AI Weekly Chronicles - August'25 Week I
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Understanding_Digital_Forensics_Presentation.pptx
Unlocking AI with Model Context Protocol (MCP)
Diabetes mellitus diagnosis method based random forest with bat algorithm
sap open course for s4hana steps from ECC to s4
Spectroscopy.pptx food analysis technology
Agricultural_Statistics_at_a_Glance_2022_0.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Empathic Computing: Creating Shared Understanding
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Cloud computing and distributed systems.
20250228 LYD VKU AI Blended-Learning.pptx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf

Network File System (NFS)

  • 1. Network File System (NFS) Introduction : NFS allows a system to share directories and files with others over a network. By using NFS, users and programs can access files on remote systems almost as if they were local files. Prerequisites : we’ll use the following IP addresses as stand-ins for the host and client values: 1. Host : 10.142.0.3 2. Client: 10.140.0.2 3. Private Network . you should replace these values with your own host and client ip addresses. Step1-Installation: At a terminal prompt enter the following command to install the NFS Server: On the Host: Host$ sudo apt-get update Host$ sudo apt-get install nfs-kernel-server On the Client: Client$ sudo apt-get update Client$ sudo apt-get install nfs-common Linux System AdministrationAbdullah Roomi:Student Name NFSSubject: 21410051Student No: amjad al husseini.MScTeacher:
  • 2. Step2-Creating the Share Directories on the Host We're going to share two separate directories, with different configuration settings. Host$: sudo mkdir /Server/Sharefile –p Host$: sudo ls -la /Server/Sharefile output: Since we’re creating it with sudo, the directory is owned by root here on the host. drwxr-xr-x 2 root root 4096 Mar 4 18:12 . NFS will translate any root operations on the client to the nobody:nogroup credentials as a security measure. Therefore, we need to change the directory ownership to match those credentials. Host$ sudo chown nobody:nogroup /Server/Sharefile Host$ ls -la /Server/Sharefile Output: drwxr-xr-x 2 nobody nogroup 4096 Mar 4 18:12 . This directory is now ready for export. Step 3 — Configuring the NFS Exports on the Host Server Next, we’ll dive into the NFS configuration file to set up the sharing of these resources. Open the /etc/exports file in your text editor with root privileges: Host$ sudo nano /etc/exports The file has comments showing the general structure of each configuration line. The syntax is basically: /Server/Sharefile 10.140.0.2 (rw,sync,no_subtree_check)
  • 3. Let’s take a look at what each one means. 1. rw: This option gives the client computer both read and write access to the volume. 2. sync: This option forces NFS to write changes to disk before replying. This results in a more stable and consistent environment since the reply reflects the actual state of the remote volume. However, it also reduces the speed of file operations. 3. no_subtree_check: This option prevents subtree checking, which is a process where the host must check whether the file is actually still available in the exported tree for every request. This can cause many problems when a file is renamed while the client has it opened. In almost all cases, it is better to disable subtree checking. When you are finished making your changes, save and close the file. Then, to make the shares available to the clients that you configured, restart the NFS server with the following command: Host$ sudo systemctl restart nfs-kernel-server Step 4 — Adjusting the Firewall on the Host First, let’s check the firewall status to see if it’s enabled and if so, to see what's currently permitted Host$ sudo ufw status Output: Status: active Use the following command to open port 2049 on the host, being sure to substitute your client's ip address: Host$ sudo ufw allow from 10.140.0.2 to any port nfs You can verify the change by typing: Host$ sudo ufw status
  • 4. Output: Status: active To Action From -- --- --- OpenSSH ALLOW Anywhere 2049 ALLOW 10.140.0.2 This confirms that UFW will only allow NFS traffic on port 2049 from our client machine. Step 5 — Creating the Mount Points on the Client Now that the host server is configured and serving its shares, we’ll prepare our client. In order to make the remote shares available on the client, we need to mount the host directory on an empty client directory. We’ll create directory for our mounts: Client$ sudo mkdir /Client/Sharefile -p Step 6 — Mounting the Directories on the Client Client$ sudo mount 10.142.0.3:/Server/Sharefile /Client/Sharefile You can double-check that they mounted successfully in several ways 1. df –h 2. mount 3. findmnt client@instance-6:~$ df -h Filesystem Size Used Avail Use% Mounted on
  • 5. udev 1.8G 0 1.8G 0% /dev tmpfs 370M 5.2M 365M 2% /run /dev/sda1 9.7G 1.3G 8.4G 13% / tmpfs 1.9G 0 1.9G 0% /dev/shm tmpfs 5.0M 0 5.0M 0% /run/lock tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup tmpfs 370M 0 370M 0% /run/user/1001 10.142.0.3:/Server/Sharefile 9.7G 1.3G 8.4G 13% /Client/Sharefile Step 7 — Testing NFS Access Next, let’s test access to the shares by writing something to each of them. Client$ sudo touch /Client/Sharefile/test.txt Client$ sudo nano test.txt Welcome in test.txt Output: Welcome in test.txt Then, check its ownership: Client$ ls -la /Client/Sharefile Output: drwxr-xr-x 2 nobody nogroup 4096 Mar 4 18:12 . Step 8 — Mounting the Remote NFS Directories at Boot We can mount the remote NFS shares automatically at boot by adding them to /etc/fstab file on the client. Open this file with root privileges in your text editor: Client$ sudo nano /etc/fstab 10.142.0.3:/Server/Sharefile /Client/Sharefile nfs auto,nofail,noatime,nolock,intr,tcp,actimeo=1800 0 0
  • 6. Step 9 — Unmounting an NFS Remote Share Client$ sudo umount /Client/Sharefile Client$ df -h 1 References 1 https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nfs-mount-on-ubuntu-16-04