Setting up NFS client/server

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
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Installing Postfix with MySql backend and TLS

In this tutorial we’ll install a ready to use Postfix mail server with MySql backend for virtual...

Installing ionCube

ionCube protects software written using the PHP programming language from being viewed,...

Installing PowerDNS on etch/lenny

The PowerDNS Nameserver is a modern, advanced and high performance authoritative-only nameserver....

Installing Zenoss monitoring system

Zenoss is an award-winning open source IT monitoring product that effectively manages the...

Upgrade from etch to lenny

Debian has released a stable version of Debian 5.0 (lenny). If you’re running previous version of...