From Andreida
Jump to: navigation, search


install the server (which gets the dependencies nfs-common and portmap:

apt-get install nfs-kernel-server

Export the directory you want to share in /etc/exports:


Disallow all machines to use the services around nfs via /etc/hosts.deny


Allow your clients to use the services arround nfs via /etc/hosts/allow

portmap: ,
lockd: ,
rquotad: ,
mountd: ,
statd: ,

Restart the services

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

If you change your /etc/exports file while your nfs is running, use this command to force an update:

exportfs -rav


Install the client: (portmap is a dependency)

apt-get install nfs-common

Test the nfs:

mount server:/home /mnt/test
ls /mnt/test

Get the correct entry:

cat /etc/mtab
umount /mnt/test

Set it, so this is done for every boot:

vi /etc/fstab
mount /mnt/home

Example for the /etc/fstab:

my-private-server:/mnt/home /mnt/home nfs rw,addr= 0 0

Check the owner of the mounted data with

ls -l /mnt/home

If the owner is something like 300, consider adding a group

addgroup --gid 300 sambagroupOrSo

and adding the user to the group

adduser <user> <group>

You can find out the gid and name of the files in the /etc/group file of the server.