Ben Shi

Blog Post

Share linux folders using NFS

Posted Under: notes
March 13, 2016

I’ve moved all my disk mounts on my HP Proliant Server over from Samba to NFS.

The steps below are for a simple setup used in my own home and by no means secure.

Install NFS

sudo apt-get install rpcbind nfs-kernel-server

Setup Configuration File

sudo vim /etc/exports

# Added the following line to the file (add additional lines for new shares)
#
# - Path to share: replace with path you'd like to share e.g. /mnt/shareme
# - Client ip or subnet: replace with the ip address of the client or a
#   collection of ip address using subnet masks e.g. 10.1.1.1 or 10.1.1.0/24
# - YYYY: anonuid = maps all anonymous connections to a uid local to the server
# - ZZZZ: anongid = maps all anonymous connections to a gid local to the server

<path to share> <client ip or subnet>(rw,sync,no_subtree_check,insecure,anonuid=<YYYY>,anongid=<ZZZZ>)

Restart NFS Server

sudo service nfs-kernel-server restart

Additional Info: https://help.ubuntu.com/community/SettingUpNFSHowTo


Ben Shi

I'm Ben Shi, a Sydney-based Full Stack Software Engineer specialising in micro-services and API development. This is a playground for me to document my learnings and experiences as a technologist.

You can find out a little bit more about me over here.

Contact: [email | twitter| linkedin]