File sharing via NFS (Debian Etch)

The Brew: Filesharing with NFS under Debian Etch

What we need

Server:

  • nfs-common
  • nfs-kernel-server
  • portmap

Client

  • nfs-common
  • portmap
  • * tried using it without these services, still works

Server config

main configuration file concerned:/etc/exports

mine read:

/osimages/centos5 10.10.10.0/24(ro,insecure,all_squash)

where:

/osimages/centos5 – shared directory

10.10.10.0/24 – allowed subnet to mount the above shared directory

(ro,insecure,all_squash) – options

The options determine how the client connection is handled:

  • ro – read only. rw – read/write. When a NFS share is read only, the client can not write changes to the NFS share.
  • secure,insecure – “secure” in this case means that the NFS server checks that the process on the client is running with root privileges. This prevents regular users on the client machine from bypassing file system permissions.
  • root_squash, no_root_squash, all_squash – by default, root on the client system is root on the server system. root_squash tells the server to treat root on the client as if it were nobody. all_squash maps all users to nobody.

 

Mounting it on the client

mount -t nfs 10.10.10.1:/osimages/centos5 /mnt/nfshare

resources

Mag-iwan ng Puna