Delete Set public Set private Add tags Delete tags
  Add tag   Cancel
  Delete tag   Cancel
  • • DevOps notes •
  •  
  • AI
  • Tags
  • Login

Share folder (NFS and Samba)/shaare/0MCBLg

  • linux
  • linux

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
  • 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
2 months ago Permalink
cluster icon
  • Computer Storage / Disk Partition : Computer Storage Local → RAM / HDD / SSD DAS (Direct Attached Storage) USB HDD / DVD SAN (Storage Area Network) through iSCSI cable or fiber ...
  • Linux File Ownership, ACLs, and I/O Redirects : File Ownership chown → Change ownership chgrp → Change group Access Control List (ACL) setfacl → Set file ACL getfacl → Get file ACL Add Permissi...
  • Systemctl, process management : Basic System Info Commands uptime → time now, up since, numbers of users, load average hostname → ip hostname uname -a → current OS and kernel info w...
  • Linux filesystem : Directory Description /boot Grub.cfg /root home of root /dev system device (mouse, keyboard) /etc configuration files /bin → /usr/bin e...
  • SED: Stream Editor for Text Manipulation : Basic Replace Syntax: sed -i 's/KENNY/LENNY/g' filename Substitute all occurrences of "KENNY" with "LENNY" Delete Line Containing String: s...


(97)
Filter untagged links
Fold Fold all Expand Expand all Are you sure you want to delete this link? Are you sure you want to delete this tag? The personal, minimalist, super-fast, database free, bookmarking service by the Shaarli community