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
  • Ldap Secure Ssh : Check on listening port netstat -tunlp → check open/listening port Securing SSH config more /etc/ssh/sshd_config change port 22 PermitRootLogin ...
  • Special Permissions (SetUID, SetGID, Sticky Bit) : chmod u+s xyz.sh → add SetUID (user-level special permission) chmod g+s xyz.sh → add SetGID (group-level special permission) chmod u-s xyz.sh → remov...
  • Crontab / at : Crontab Basics crontab -e → edit crontab crontab -l → list crontab entries crontab -r → remove crontab entries systemctl status crond → check crond s...
  • Tuned : Tweaks with Tuned / Podman Tweaks with Tuned systemctl enable tuned tuned-adm active check which profile is active tuned-adm list list all prof...
  • Package Management : System Updates & Software Install dnf (yum) → RedHat → /etc/yum.repos.d apt-get → Debian rpm → RedHat package management standalone package to ...


(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