Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

Network file system

NFS
It is a remote filesystem used to export share to unix-linux clients

Port and Protocol - 2049/tcp

Latest version - 4
NFS server configuration
#install software

yum install nfs-utils -y

#start and enable service

systemctl start nfs-server

systemctl enable nfs-server

#create share and edit configuration

mkdir /share1

vi /etc/exports or /etc/exports.d/*.exports

/share1 192.168.2.0/24(sync)
#update the share

exportfs -rv

#allow nfs via firewalld

firewall-cmd --add-service=nfs --per

firewall-cmd --reload
NFS client mounting
● Mount command (temporary)

● /etc/fstab configuration (permanent)

● Autofs (on demand)


Mount command (temporary)
mount nfsserver:/share1 /mnt
Edit /etc/fstab (Permanent)
vi /etc/fstab

nfsserver:/share1 /mnt nfs defaults 0 0

:wq

mount -a
Autofs configuration
#install software

yum install nfs-utils autofs -y

#start and enable service

systemctl start autofs

systemctl enable autofs

#edit configuration files

/etc/auto.master

/etc/*.home
vi /etc/auto.master

/mnt /etc/*.home --timeout=20

vi /etc/*.home

share1 -ro,sync nfsserver:/share1

#restart service

systemctl restart autofs


read only (ro) share to all login users in client
read write (rw) share to all login users in client
#service permission
/share1 192.168.2.0/24(rw,sync)

#manage permission
chmod 757 /share1
(ro) or (rw) share for specific user or group
● integrate nfs-server and nfs-client to central authentication server

You might also like