Debian Tutorials Copy/Paste tutorials for Debian based Linux distros

27Oct/080

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

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Reddit
  • StumbleUpon
  • Technorati
  • email
  • Live
  • Slashdot
  • LinkedIn
  • Print
  • Tumblr
  • Twitter
  • Netvibes
  • Netvouz
  • PDF
  • Yahoo! Bookmarks
Tagged as: , , Leave a comment
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


No trackbacks yet.