Debian Tutorials

Debian Tutorials


Step by step tutorials showing you how to install and configure various applications and services on Debian based Linux distros.

December 2024
M T W T F S S
 1
2345678
9101112131415
16171819202122
23242526272829
3031  

Categories


Setting up NFS client/server

adminadmin

Network File System (NFS) is a network file system protocol originally developed by Sun Microsystems in 1983, allowing a user on a client computer to access files over a network as easily as if the network devices were attached to its local disks.

Server

1. Install the server package

apt-get install nfs-kernel-server

2. Grant permission to a client computer

Add the following line to /etc/exports to grant read only permissions to the folder /var/www for the ip address 192.168.1.2:

/var/www 192.168.1.2(rw,root_squash)

Available options:

ro = Read only access
rw = Read/Write access
root_squash = Replace logins from root user with nobody to avoid superuser privileges over nfs
Restart the server to enable the changes

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

Client

Create the target mount folder

mkdir /mnt/www

Mount the file system:

mount 192.168.1.1:/var/www /mnt/www

Optionally you can mount the filesystem on system boot by adding entry to the /etc/fstab file:

192.168.1.1:/var/www /mnt/www nfs

Comments 0
There are currently no comments.