English Français

sharing files with NFS

NFS stands for Network File System, and yes this does mean that you can share files over the network.. . basically what you do with this is mount folders from a server onto a client. NFS uses IP addresses for "authentication", also it uses the servers file permissions plus UID and GID
now enough bla blah and lets just. ..

installing the server (with debian)

for the server we will need :

configuration

first step is define what needs to be shared in the file /etc/exports

/mnt/share 192.168.88.8 (rw) 10.20.30.100 (ro)
/home/user/other 192.168.88.8 (rw)

explanations :

now configure hosts allow and deny

/etc/hosts.deny by default close everything :

portmap:ALL
lockd:ALL
mountd:ALL
rquotad:ALL
statd:ALL

/etc/hosts.allow here we can open access for those we want to :

portmap: 192.168.88.8 10.20.30.100
lockd: 192.168.88.8 10.20.30.100
mountd: 192.168.88.8 10.20.30.100
rquotad: 192.168.88.8 10.20.30.100
statd: 192.168.88.8 10.20.30.100

restarting services

very simple of course

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

on the clients

having a network file server is cool but without any clients . .. might as well close shop. . :]
so we shall need :

client configuration

now all we need to do is mount the NFS resource, for this we have a few possibilities, manual mounting, fstab or on demand with autofs (check out the article autofs)

we shall consider that :

now we can go through the different ways of mount all this crap, i mean network file system.. .

  1. manual method (got root ?)
  2. mount NFS_SERVER:/mnt/share /home/user/share
  3. the /etc/fstab way of life
  4. NFS_SERVER:/mnt/share /home/user/share nfs rw 0 0
  5. using autofs \o/
  6. share rw NFS_SERVER:/mnt/share

    with a few more options this can become :

    share -rsize=8192,wsize=8192,soft,timeo=14,rw NFS_SERVER:/mnt/share

quelques options de montage NFS

for just plain more info

http://tldp.org/HOWTO/NFS-HOWTO/

Add A Comment

Add A Comment

This is a captcha-picture. It is used to prevent mass-access by robots. (see: www.captcha.net)
Code in the picture:
Your Name(*):
Email:
Website:
Comment(*):