Simple NFS in Linux 7

The Network File System (NFS) is a network file system commonly used by UNIX systems and network-attached storage devices to allow multiple clients to share access to files over the network. it providers access to shared directories or files from client systems.
The NFS protocol transmits data in clear text over the network. Further, the server relies on the client to identify users. It is not recommended to export directories with sensitive information without the use KERBEROS authentication and encryption, which is covered later in this section.

Service Profile

A.  Package
nfs-server [server]
nfs-utils [client]

B.  Configuration
etc/exports

C.  Daemons
rpc.statd
rpc.quotad
rpc.mounted

D.  Service
nfs-server

E.  Port number
2048

        [SERVER SIDE]

#mkdir /[directory name]

example :- mkdir /data
(create directory for sharing)

#cd /data
(go to data folder/directory)

#mkdir a b c
(create folder in data)

#yum -y install nfs*
(Install NFS service [NFS* because all service is install for nfs require])

#semanage fcontext -a -t public_content_t '/[sharing Directory name](/.*)?'

example :- semanage fcontext -a -t public_content_t '/data(/.*)?'
(Add Content on sharing Folder/directory)

#restorecon -vFR /data
(Restore Add content directory)

#ls -ldZ /data
(Show content)

#vim /etc/exports
Entry :- /[sharing folder] [IP address would you like share the directory]/[subnet] (permission)
example :- /data 172.25.2.24/24(ro)
This permission is read only. You also give read write permission with this
/data 172.25.2.24/24(rw,sync)

#systemctl restart nfs-server
#systemctl enable nfs-server
(Start service)

#firewall-cmd --permanent --add-service=nfs
#firewall-cmd --reload
(Allow NFS service in firewall)

        [CLIENT SIDE]

#yum -y install nfs-utils
(Install service)

#mkdir /mnt/nfsshare
(Create mount folder)

#vim /etc/fstab
Entry IN LAST LINE :-
server[foundation number]: [sharing directory] [mount directory] nfs defaults 0 0
 example :- server2: /data /mnt/nfsshare nfs defaults 0 0
(save)

#mount -a
(This command is successful run then you’re all right)
(you rum command but you see ERROR please Retry)

#df -h

(for check)


Comments

Popular Posts