EX300(23Q) · Question #8
Configure serverX with the following requirements. Share the /nfsshare directory within the example.com domain clients only, share must be writable. Create a directory named as protected under…
yum install -y nfs-utils mkdir -p /nfsshare chmod 0777 /nfsshare vim /etc/exports /nfsshare (example.com)(rw) systemctl restart nfs-server systemctl enable nfs-server firewall-cmd --permanent --add-service=nfs firewall-cmd --reload mkdir -p /nfssecure wget -O /etc/krb5.keytab…
Question
- Share the /nfsshare directory within the example.com domain clients only, share must be writable.
- Create a directory named as protected under /nfssecure
- The exported directory should have read/write access from all subdomains of the example.com domain.
- Ensure the directory /nfssecure/protected should be owned by the user harry with read/write permission.
Explanation
yum install -y nfs-utils
mkdir -p /nfsshare chmod 0777 /nfsshare
vim /etc/exports /nfsshare *(example.com)(rw)
systemctl restart nfs-server systemctl enable nfs-server firewall-cmd --permanent --add-service=nfs firewall-cmd --reload
mkdir -p /nfssecure wget -O /etc/krb5.keytab http://station.network0.example.com/pub/keytabs/serverX.keytab
vim /etc/sysconfig/nfs RPCNFSDARGS="-V 4.2"
systemctl enable nfs-secure-server
mkdir /nfssecure/protected
vim /etc/exports /nfssecure *.example.com(rw,sec=krb5p,sync)
grep -i "harry" /etc/passwd
(If it return nothing,then create the user harry) [student@~] useradd -s /sbin/nologin -u 3000 harry -It SHOULD BE nologin or not?![indent]
chown harry /nfssecure/protected
Best it to do like this:
setfacl -m u:harry:rwx /nfssecure/protected
exportfs -r semanage fcontext -a -t public_content_rw_t "/nfsshare(/.)?" semanage fcontext -a -t public_content_rw_t "/nfssecure(/.)?" restorecon -Rv /nfssecure/
firewall-cmd --permanent --add-service=rpc-bind firewall-cmd --permanent --add-service=mountd firewall-cmd --reload
systemctl restart nfs-server systemctl restart nfs-secure-server systemctl enable nfs-secure-server
Topics
Community Discussion
No community discussion yet for this question.