···11+### Setting up NFS
22+33+#### Server
44+55+install the server package:
66+```sh
77+apt install nfs-kernel-server
88+```
99+1010+add shares to /etc/exports; for example:
1111+```
1212+<local-path> <remote-ip-(range)/CIDR>(rw,sync,no_subtree_check)
1313+```
1414+1515+if the remote user has a different userid you can use nfsidmap;
1616+or use the simple approach of mapping all users to a specific uid on the server.
1717+1818+by adding `all_squash,anonuid=<uid-of-choice>` like this:
1919+2020+```
2121+<local-path> <remote-ip-(range)/CIDR>(rw,sync,no_subtree_check,all_squash,anonuid=<uid-of-choice>)
2222+```
2323+2424+you can then export your exports using
2525+```sh
2626+exportfs -arv
2727+```
2828+-a -> all
2929+-r -> reexport
3030+-v -> list exported shares
3131+3232+3333+#### Client
3434+3535+install the client package:
3636+```sh
3737+apt install nfs-common
3838+```
3939+4040+mount your nfs share using:
4141+```sh
4242+mount -t nfs4 <nfs-server-ip/hostname>:<share-path> <local-path>
4343+```
4444+4545+assuming that worked; add it to /etc/fstab so it gets mounted at boot
4646+```
4747+<nfs-server-ip/hostname>:<share-path> <local-path> nfs4 defaults,user,exec 0 0
4848+```
4949+5050+if you arnt certain the share will always be available; add `noauto`
5151+```
5252+<nfs-server-ip/hostname>:<share-path> <local-path> nfs4 defaults,user,exec,noauto 0 0
5353+```
5454+and then use `mount -a` to mount it