Access Network-Attached Storage (NFS and Samba) Flashcards
1
Q
What are the steps for NFS Server configuration?
A
- Install NFS Packages
yum install nfs-utils libnfsidmap - Enable/Start NFS services
systemctl enable rpcbind | nfs-server
systemctl start rpc bind nfs-server rpc-statd
rpc-idmapd - Create NFS share directory and assign permissions
mkdir /nfsshare
chmod a+rwx /nfsshare - Modify /etc/export file to add new shared
filesystem
/nfsshare 192.x.x.x (rw,sync,no_root_squash)
/nfsshare *(rw,sync,no_root_squash) - Export the NFS filesystem
exportfs -rv
2
Q
What are the steps for NFS client configuration? Bonus: How can you unmount the NFS share?
A
- Install NFS Packages
yum install nfs-utils rpcbind - Enable and start rpcbind service
systemctl enable rpcbind
systemctl start rpcbind - Make sure firewalld or iptables is stopped
ps -ef | egrep “firewalld|iptables” - Show mount from the NFS server
showmount -e 192.168.1.x - Create a mount point
mkdir /mnt/appnfs - Mount NFS Filesystem
mount 192.168.1.x:/nfsshare /mnt/appnfs - Verify Mount
df -h - Bonus: To Unmount
umount /mnt/nfsshare
3
Q
What protocols are used to share Samba?
A
SMB, SMB v2, SMB v3, CIFS
4
Q
What are the steps to configure Samba on Linux?
A
- Snapshot VM
- Install Samba Packages
yum install samba samba-client samba-common - Enable Samba To Be Allowed Through Firewall
firewall-cmd –permanent –zone=public
–add-service=samba
firewallcmd –reload - Create Samba Share Driectories and Assign permissions (-p option creates parent directory
mkdir -p /samba/name
chmod a+rwx /samba/name
chown -R nobody:nobody /samba/name - Also Change the SELinux Security Context for Samba Share Directory (-t option is for type)
chcon -t samba_share_t /samba/name - Modify /etc/samba/smb.conf file to add new shared filesystem
[global]
workgroup = WORKGROUP
netbios name = centos
security = user
map to guest = bad user
dns proxy = no
[Anonymous]
path = /samba/name
browsable = yes
writable = yes
guest ok = yes
guest only = yes
read only = yes
[Secure]
path = /samba/securename
valid users = user
guest ok = no - Verify Settings
testparm - Enable/Start Samba Services
systemctl start|enable smb|nmb - Mount Samba Share on Linux Client
yum install cifs-utils samba-client
mkdir /mnt/share
mount -t cifs //192.x.x.x/Anonymous /mnt/share