aboutsummaryrefslogtreecommitdiff
path: root/nfs
diff options
context:
space:
mode:
authorIbrahim Mkusa <ibrahimmkusa@gmail.com>2024-08-13 06:43:26 -0400
committerIbrahim Mkusa <ibrahimmkusa@gmail.com>2024-08-13 06:43:26 -0400
commitfbd45fd0b106d0b268942566d5ae1284abc50733 (patch)
tree1348f3957c799f68d520a39fd253b11c1ec2966d /nfs
parent56bcdb6f7dcb2785c21dcd7e6b298826c50d6c74 (diff)
fun with nfsHEADmain
Diffstat (limited to 'nfs')
-rw-r--r--nfs/creating_nfs_shares.md54
1 files changed, 54 insertions, 0 deletions
diff --git a/nfs/creating_nfs_shares.md b/nfs/creating_nfs_shares.md
new file mode 100644
index 0000000..8dbb916
--- /dev/null
+++ b/nfs/creating_nfs_shares.md
@@ -0,0 +1,54 @@
+** On the Server **
+This documents takes you through setting nfs shares on a fedora family OS. The
+core packages that need to be present are =autofs, nfs-utils=
+```
+sudo dnf install autofs nfs-utils
+```
+Create the directories to share. In this case two folders under the share
+directory
+```
+mkdir -p /shares/share{1,2}
+```
+To tell nfs-server, what folders to share we edit the ==/etc/exports== with the
+following lines:
+```
+/shares *(rw,no_root_squash)
+```
+For more examples on how to edit ==/etc/exports== consult the man page at `man
+exports` and navigate to the bottom of the page.
+```
+systemctl start nfs-server
+systemctl enable nfs-server
+```
+Allow external programs access by changing the firewall(nftables). Rpcbind,
+mountd, nfs are related services that need access.
+```
+for i in rpc-bind mountd nfs; do firewall-cmd --permanent --add-service $i; done;
+firewall-cmd --reload
+firewall-cmd --list-services # confirm changes
+```
+
+**On the Client**
+Make sure the required packages are installed as seen above. Use ==showmount==
+to verify the shared folders.
+```
+showmount -e ip_address_server/hostname # verify /etc/hosts in case of issues
+```
+Tell autofs the shared folders to mount and the location of their config file.
+```
+# in /etc/auto.master
+/shares /etc/auto.shares # replaces shares with any file/name
+```
+Tell autofs how to mount /shares in /etc/auto.shares
+```
+* -rw hostname:/shares/&
+```
+Mounts all folders exported thanks to the wildcard character. The ampersand
+matches any subdirectory in the ==/shares==
+
+Start the autofs service
+```
+systemctl start autofs
+systemctl enable autofs
+```
+Confirm folder gets mounted when you navigate to it `cd /shares/`