0

This seems trivial but I've lost too much time searching and reading manuals. RHEL 7.9 server.

I have a simple directory being exported on nfs v4, using /etc/exports, with specific options.

[ ~]# cat /etc/exports /path/to/my/share/ remoteserver.host.com(rw,no_root_squash,sync,insecure) [ ~]# 

This is exported using: ]# exportfs -ra

However, if I view the verbose export information, I'm seeing many more options, which are breaking the intended share operations. Yes, I know I can be more explicit in /etc/exports but I'm interested to understand where it's coming from because it's a new issue that has creeped up.

 ~]# exportfs -v /path/to/my/share/ remoteserver.host.com(sync,wdelay,hide,no_subtree_check,sec=sys,rw,insecure,no_root_squash,no_all_squash) [ ~]# 

You can see the additional options, and in my case, specifically hide is creating trouble.

I've checked: /etc/nfsmount.conf but it's fully commented out.

    2 Answers 2

    0

    From the documentation; emphasis on that last line is mine:

    The default settings are:

    • ro The exported file system is read-only. Remote hosts cannot change the data shared on the file system. To allow hosts to make changes to the file system (that is, read and write), specify the rw option.
    • sync The NFS server will not reply to requests before changes made by previous requests are written to disk. To enable asynchronous writes instead, specify the option async.
    • wdelay The NFS server will delay writing to the disk if it suspects another write request is imminent. This can improve performance as it reduces the number of times the disk must be accessed by separate write commands, thereby reducing write overhead. To disable this, specify the no_wdelay. no_wdelay is only available if the default sync option is also specified.
    • root_squash This prevents root users connected remotely (as opposed to locally) from having root privileges; instead, the NFS server assigns them the user ID nfsnobody. This effectively "squashes" the power of the remote root user to the lowest local user, preventing possible unauthorized writes on the remote server. To disable root squashing, specify no_root_squash.

    [ ... ]

    Each default for every exported file system must be explicitly overridden.

    1
    • Thanks for that but I think this is where I'm getting hung up. T here are only 4 defaults in the document; ro, sync, wdelay, root_squash. I can't determine where these are coming from; hide,no_subtree_check,sec=sys,no_all_squash This is where I'm somewhat stuck....yes, I know I can define around it, I'm mostly interested finding where/how? Maybe I'll have to dig into the exports source code...
      – hsx
      CommentedJan 16 at 16:24
    0

    When exportfs runs, it reads /etc/exports and proceeds to write out /var/lib/nfs/etab via the xtab_export_write function. This calls putexportent for each export. This function writes out a formatted string for each export entry. It just happens to be written so that it always outputs certain options, such as the ones you're curious about, unless flags to negate them are set when /etc/exports was parsed.

      You must log in to answer this question.

      Start asking to get answers

      Find the answer to your question by asking.

      Ask question

      Explore related questions

      See similar questions with these tags.