This video is part of the Random Linux Stuff Playlist:
• Random Linux Stuff
Server
#create directory and set permissions
mkdir /mnt/worldshare
chmod a+rwx /mnt/worldshare
chmod o+t /mnt/worldshare
#install nfs-utils and enable nfs
dnf install -y nfs-utils
systemctl enable nfs-server --now
#add the following line to the /etc/exports file
"/mnt/worldshare *(rw)"
systemctl restart nfs
setup firewalld to allow NFS
firewall-cmd --permanent --add-service=nfs
firewall-cmd --permanent --add-service=mountd
firewall-cmd --permanent --add-service=rpc-bind
firewall-cmd --reload
firewall-cmd --list-all --zone=public|grep services
Client
install nfs-utils
dnf install -y nfs-utils
create mountpoint and mount the nfs-share
mkdir /mnt/share
mount server://mnt/worldshare /mnt/share
add mount to /etc/fstab
"server:/mnt/worldshare /mnt/share nfs defaults 0 0"
add users
useradd nfsuser1
useradd nfsuser2
echo "nfsuser1:badpassword"|chpasswd
echo "nfsuser2:badpassword"|chpasswd
su - user1
cd /mnt/share
touch file1
su - user2
cd /mnt/share
touch file2
rm file1
rm file2
---
Link to mounting filesystems using systemd:
• Linux mounting file systems using Systemd
#linux #worldwritable #stickybit