Share folder (NFS and Samba)/shaare/0MCBLg
NFS → Network File System
- Share folder
NFS Server
-
dnf install nfs-utils libnfsidmap -
systemctl enable rpcbind -
systemctl enable nfs-server -
systemctl start rpcbind -
systemctl start nfs-server -
systemctl start rpc-statd -
systemctl start nfs-idmapd -
mkdir /myshare -
chmod a+rwx /myshare -
nano /etc/exports
/myshare *(rw,sync,no_root_squash)
exportfs -rv→ export NFS file system
NFS Client
-
dnf install nfs-utils rpcbind -
service rpcbind start- Start package
-
ps -ef | egrep "firewall|iptable"- Disable firewall in case on server
-
showmount -e 192.168.0.100- Show mount from NFS server
192.168.0.100= NFS server IP
-
mkdir /mnt/app→ create mount point -
mount 192.168.0.100:/myshare /mnt/app- Mount NFS file system
-
df -h→ verify mounted system -
umount /mnt/app
SAMBA
-
SMB→ Server Message Block -
CIF→ Common Internet File System -
Samba protocol
-
dnf install samba samba-client samba-common -
firewall-cmd --permanent --zone=public --add-service=samba -
firewall-cmd --reload- Add rule to firewall
-
mkdir -p /samba/myshare -
chmod a+rwx /samba/myshare -
chown -R nobody:nobody /samba- Create Samba share directory
-
chcon -t samba_share_t /samba/myshare- Change SELinux security context
-
nano /etc/samba/smb.conf- Add new filesystem shared
[anonymous]
path = /samba/myshare
browsable = yes
writable = yes
guest ok = yes
guest only = yes
read only = no
-
testparm- Test SMB configuration
-
systemctl enable smb -
systemctl start smb- Start Samba service
Mount on Linux Client
-
dnf -y install cifs-utils samba-client -
mkdir -p /mnt/sambashare -
mount -t cifs //192.168.0.35/anonymous /mnt/sambashare- Mount Samba share without password
Secure Samba Server
-
useradd larry -
groupadd smbgrp -
usermod -a -G smbgrp larry -
smbpasswd -a larry- Set Samba password for
larry
- Set Samba password for
-
mkdir /samba/secureshare -
chown -R larry:smbgrp /samba/secureshare -
chmod -R 0770 /samba/secureshare -
chcon -t samba_share_t /samba/secureshare
Samba Secure Share
nano /etc/samba/smb.conf
[secure]
path = /samba/secureshare
valid users = @smbgrp
guest ok = no
writable = yes
browsable = yes
systemctl restart smb
(97)