NFS

From AlphaBook
Jump to: navigation, search

Install

  • yum info nfs-utils
  • yum install nfs-utils -y

Configurate Service

  • systemctl start rpcbind nfs-server
  • systemctl enable rpcbind nfs-server

exports

  • vi /etc/exports
  • /backup 192.168.1.0/24(rw,sync)
  • exportfs -rv
  • showmount -e localhost

Firwall

  • firewall-cmd --permanent --add-service=nfs
  • firewall-cmd --permanent --add-service={nfs3,mountd,rpc-bind}
  • firewall-cmd --reload

Mount NFS on another system (manually)

  • mount -t nfs 192.168.1.100:/backup /nfs/backup -o rw
  • umount /nfs/backup

Mount NFS on another system (auto - fstab)

  • vi /etc/fatab
  • 192.168.1.100:/backup /nfs/backup nfs defaults 0 0
  • man fstab
  • man nfs

Mount NFS on another system (auto - autofs)

  • yum info autofs
  • yum install autofs -y
  • systemctl start autofs
  • systemctl enable autofs
  • vi /etc/auto.master
  • /nfs /etc/nfs.misc
  • vi /etc/nfs.misc
  • backup -fstype=nfs,rw 192.168.1.100:/backup
  • cd /nfs/backup

Not secure

  • NFS is not secure by default
  • More ...