Supprimer Rendre public Rendre privé Add tags Delete tags
  Ajouter un tag   Annuler
  Supprimer le tag   Annuler
  • • DevOps notes •
  •  
  • AI
  • Tags
  • Connexion

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
3 months ago Permalien
cluster icon
  • NTP and Mail : NTP / Chronyd → Time Synchronisation nano /etc/chrony.conf → edit conf systemctl start chronyd systemctl enable chronyd chronyc → interactive cmd t...
  • Package Management : System Updates & Software Install dnf (yum) → RedHat → /etc/yum.repos.d apt-get → Debian rpm → RedHat package management standalone package to ...
  • 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...
  • Logical Volume Management (LVM) : LVM (Logical Volume Management) Combine disk together by software Add new HDD on the fly to extend disk space Set LVM in Linux install Desired...
  • Bash : First Line of Script #!/bin/bash → defines the shell interpreter Comments Use # for commenting Common Elements Commands: echo, cp, etc. Statement...


(110)
Filtrer par liens sans tag
Replier Replier tout Déplier Déplier tout Êtes-vous sûr de vouloir supprimer ce lien ? Êtes-vous sûr de vouloir supprimer ce tag ? Le gestionnaire de marque-pages personnel, minimaliste, et sans base de données par la communauté Shaarli