12) NFS & samba service

NFS & Samba service
________________________________________________________________________________________________________________________

v NFS
    NFS stand for Network File Sharing. NFS is a service to share data in the network. NFS allows local access to remote file. It uses client/server model to share the data. NFS service supportable only Linux based operating system.

Ø NFS server package include three facilities :-
              1) Portmap:- It map call made by other machine to correct RPC service.
                2) nfs:- It translates remote file sharing request into request on local file system.
                3) rpc.mountd:- This service is responsible for mounting and unmounting the file.

Ø NFS Configuration File:-
1)  /etc/exports: - It’s a main configuration file of NFS, all exported files and directories are
 defined in this file at the NFS Server end.

2)  /etc/stabs:- To mount a NFS directory on your system across the reboots, we need to make an entry in /etc/fstab.

3) /etc/sysconfig/nfs:- Configuration file of NFS to control on which port rpc and other services are listening.

  v Configuration of NFS server in Linux operating system.

Ø On Server side – (installed NFS)
#        yum ɸ install ɸ nfs – server
#        systemctl ɸ start ɸ nfs – server
#        systemctl ɸ status ɸ nfs – server
#        systemctl ɸ enable ɸ nfs – server

Ø Firewall setting on server  -
#        firewall – cmd ɸ - - permanent ɸ - - add – service = nfs
#        firewall – cmd ɸ - - permanent ɸ - - add – service = rpc – bind
#        firewall – cmd ɸ - - permanent ɸ - - add – service = mounted
#        firewall – cmd ɸ - - reload

Ø To share Data –
#        mkdir ɸ /my project
#        chmod ɸ 777 ɸ /my project
#        touch ɸ /my project / file1.txt
#        touch ɸ /my project / file2.txt
#        vim ɸ /etc / exports

Ø On client side –
#        ping ɸ 192.168.1.100   (server IP)
#        showmount ɸ -e ɸ 192.168. 1.100
#        mkdir ɸ /accessdata
#        mount ɸ 192.168.1.100 : /my project ɸ accessdata
#        cd ɸ /accessdata
#        ll ↵

Ø For permanent mount –
#        vim ɸ /etc /fstab

  v Samba
     Samba is also a service to share data in the network. Samba works like but it supports both operating systems, windows and Linux operating system. Samba allows local access to remote file. It uses client/server model to share the data.

Ø Samba server package include two facilities –
1)      SMB:- SMB is server massage block.
2)      CIFS:- CIFS is network internet file system protocols.

Ø Samba configuration in Linux operating system –

Ø On server side- (installed Samba)
#        yum ɸ install ɸ samba *
#        systemctl ɸ enable ɸ smb
#        systemctl ɸ start ɸ smb
#        systemctl ɸ status ɸ smb

Ø Firewall setting on server  -
#        firewall – cmd ɸ - - permanent ɸ - - add – service = samba
#        firewall – cmd ɸ - - reload

Ø To share Data –
#        mkdir ɸ /smbshare
#        chmod ɸ 777 ɸ /smbshare
#        chcon ɸ - R ɸ - t ɸ smb _share_t ɸ smbshare

Ø User management -
#        useradd ɸ user1
#        passwd ɸ user1    (123)
#        smbpasswd ɸ -a ɸ user1 (1234)
#        vim ɸ /etc /samba /smb.conf
: se ɸ nu  

#        systemctl ɸ restart ɸ smb

Ø On client side –
#        yum ɸ install ɸ cifs – utils
#        ping ɸ 192.168.1.100    (server IP)
#        mkdir ɸ -t ɸ cifs ɸ / / 192.168.1.100 /smbshare ɸ  /smbaccess ɸ  - o ɸ  username
·         /smbshare → server share folder.
·         /smbaccess → client mount point.
#        df ɸ -Th
#        cd ɸ /smbaccess
#        ll



Comments