Skip to main content

Posts

How to configure Network file system (NFS) server?

67.How to configure Network file system (NFS) server? Ans. 1. Verify the service package using following command #rpmquery –qa | grep nfs 2. The export a file system we need to modify ‘/etc/exports’ file. For example we want to export /media then we’ll add the following entries in ‘/etc/exports’ file. /media 192.168.166.0/24(rw) 3. Now, with the export configured, start the daemons using the initializing scripts: #server nfs start #server nfs lock start 4. Now, use rpcinfo –p to make sure the necessary daemons are running as follow: #rpcinfo –p 5. Next, execute showmount –a to list the servers NFS exports as follow: #showmount –a 6. Finally, enable NFS from boot with the help of chkconfig. #chkconfig nfs on

How to enable Secure Network file system (NFS)?

66.How to enable Secure Network file system (NFS)? Ans. 1. The default installation does not uses NFSv4 security enhancement by default. 2. There are some step to be carried out manually and they are as follow. 3. Enable secure NFS by adding the following line to /etc/sysconfig/nfs Secure_NFS=no 4. Modify /etc/idmapd.conf and set the domain options to user domain and change Nobody- User & Nobody –group options to nobody Domain = example.com [Mapping] Nobody_User = nobody Nobody_Group = nobody 5. For the above changes to be affected, restart the portmapper using following command #service portmap restart

List and explain all NFS server commands.

65.List and explain all NFS server commands. Ans. 1. exportfs: a) The exportfs command enables user to manipulate the list of current exports without editing /etc/exports. b) It also maintains the list of currently exported file system in /var/lib/nfs/etab. Example: The exportfs –a command initializes /var/lib/nfs/etab, synchronizes it with the contents of /etc/exports. c) To add a new export to etab and also /etc/exports the syntax is : #exportfs –o opts hostdir d) Example: #exportfs –o sync,rw 192.168.166.7:/demo The above command exports the directory /demo to client 192.168.166.7 with export option rw and sync. e) –v option of this command, lists currently exported filesystem. Example: #exportfs –v f) –u options unexports the filesystem as follow: Example: #exportfs –u 192.168.166.7:/demo 2. showmount: a) The showmount command provides information about clients and the file systems they have mounted. b) Syntax is : #showmount [-advhe] [host] ...

List and explain all the status files in NFS.

64.List and explain all the status files in NFS. Ans. 1. /var/lib/nfs.rmtab – It list each NFS export that is mounted by an NFS client. It uses the Daemon rpc.mountd since it is responsible for servicing the request to mount NFS exports. Whenever , rpc.mounted daemon receives request, it adds an entry into /var/lib/nfs/rmtab. The same goes for unmounts request but in that case entry is removed from status file. 2. /var/lib/nfs/etab – It contains list of currently exported filesystem, the exportfs command maintains the entries in this file. 3. These three scripts which are initialized and controls the required NFS server daemons /etc/rc.d/init.d/portmap /etc/rc.d/init.d/nfs /etc/rc.d/init.d/nfslock 4. The portmap scripts starts the portmap daemon also called as portmapper. All programs that uses RPC, such as NIS and NFS, depends on the information the portmapper provides. 5. The primary NFS startup script is /etc/rc.d/init.d/nfs, It requires single argument. E.g. star...

List all the Network file system (NFS) scripts.

63.List all the Network file system (NFS) scripts. Ans. 1. sync – It forces NFS server to perform disk write operation before informing client that request is complete. 2. async – It makes NFS server to cache disk write operation. 3. hide – It hides subdirectory of an exported file system. 4. nohide – It unhide subdirectory of an exported file system. 5. ro – It gives read only access to clients who has mounted the exports. 6. rw – It fives read/write access to clients who has mounted the exports. 7. root_squash – It prevents root user on an NFS client from having root privileges on NFS server. 8. no_root_squash – It disables root_squash. 9. secure – It accepts only if generating from port numbers less than 1024. 10. insecure – It accepts client’s request even if generating from port numbers higher than 1024. 11. secure_blocks – It requires clients to be authenticated who request for lock operation. 12. insecure_locks – It doesn’t require clients to...

Explain the NFS server daemons.

62.Explain the NFS server daemons. Ans. NFS server needs following daemons: 1. /sbin/rpc.lockd It starts kernel’s lock manager. 2. /usr/sbin/rpc.mountd It processes nfs client’s mount requests. 3. /usr/portmap It allows client’s to discover services available on the NFS server. 4. /sbin/rpc.statd It manages lock recovery in case of server crash 5. /usr/sbin/rpc.nfsd It provides all nfs services other than file locking and quotas. 6. /usr/sbin/rpc.rquotad It provides NFS client’s quota information of NFS exports. 7. rpc.gssd Creates security contexts on RPC clients for exchanging RPC information using SecureRPC (RPCSEC) using GSS. 8. rpc.svcgssd Creates security contexts on RPC servers for exchanging RPC information using SecureRPC (RPCSEC) using GSS. 9. rpc.idmapd Maps local user and group names to NFSv4 IDs (and vice versa). 10. To start the NFS services there are two commands as follows: #service nfs start #/etc/rc.d/init.d/nfs.start 11. ...

Explain the NFS server configuration files.

61.Explain the NFS server configuration files. Ans. 1. The server configuration file is ‘/etc/exports’, which contains a list of file system to export, the clients permitted to mount them and several export options that apply to client mounts. 2. Each line in ‘/etc/exports’ has following syntax: Dir [Host] (option)[….] Dir specifies one or more mount options Host specifies one or more mount options. 3. If user omits host, the listed options apply to every possible client system and if options are omitted then the default mount options will be applied. 4. Consider the sample of ‘/etc/exports’ file as follows: a) /usr/share *.mu.ac.in(ro) It permitsall host on mu.ac.in to mount /usr/share as read only directory. b) ./courses/tyit 192.168.166.0/24 (rw) It uses the address/netmask form in which the net mask is specified in classless Inter-Domain Routing (CIDR) format. c) /home 192.168.0.0/255.255.255.0 (rw) It permits any host with an IP address in the range...