Failed to pass credentials to nfs mount












1















I am running CentOS 7 and need to mount an NFS share which is protected by credentials. I have read the nfs, mount, mount.nfs manuals and can't find the right options that work! I think the right options are 'user' and 'pass', but I've tried 'username' and 'password' and everything inbetween, but I get:



mount -t nfs -o user=root,pass=mypass lserver:/root /mnt/d0
mount.nfs: an incorrect mount option was specified


Can someone tell me the right syntax/options to make this work? (It really shouldn't be this hard)










share|improve this question



























    1















    I am running CentOS 7 and need to mount an NFS share which is protected by credentials. I have read the nfs, mount, mount.nfs manuals and can't find the right options that work! I think the right options are 'user' and 'pass', but I've tried 'username' and 'password' and everything inbetween, but I get:



    mount -t nfs -o user=root,pass=mypass lserver:/root /mnt/d0
    mount.nfs: an incorrect mount option was specified


    Can someone tell me the right syntax/options to make this work? (It really shouldn't be this hard)










    share|improve this question

























      1












      1








      1


      2






      I am running CentOS 7 and need to mount an NFS share which is protected by credentials. I have read the nfs, mount, mount.nfs manuals and can't find the right options that work! I think the right options are 'user' and 'pass', but I've tried 'username' and 'password' and everything inbetween, but I get:



      mount -t nfs -o user=root,pass=mypass lserver:/root /mnt/d0
      mount.nfs: an incorrect mount option was specified


      Can someone tell me the right syntax/options to make this work? (It really shouldn't be this hard)










      share|improve this question














      I am running CentOS 7 and need to mount an NFS share which is protected by credentials. I have read the nfs, mount, mount.nfs manuals and can't find the right options that work! I think the right options are 'user' and 'pass', but I've tried 'username' and 'password' and everything inbetween, but I get:



      mount -t nfs -o user=root,pass=mypass lserver:/root /mnt/d0
      mount.nfs: an incorrect mount option was specified


      Can someone tell me the right syntax/options to make this work? (It really shouldn't be this hard)







      mount nfs options






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Feb 1 '17 at 22:18









      TSGTSG

      3892721




      3892721






















          4 Answers
          4






          active

          oldest

          votes


















          11














          Specifying username and password are options for cifs (samba), but not nfs. According to this CentOS Documentation:




          NFS controls who can mount an exported file system based on the host making the mount request, not the user that actually uses the file system. Hosts must be given explicit rights to mount the exported file system. Access control is not possible for users, other than through file and directory permissions.







          share|improve this answer
























          • I missed that! But why is 'user' a valid parameter for NFS mounts?

            – TSG
            Feb 1 '17 at 23:44






          • 1





            Where do you see that? There is no user option in man mount.nfs.

            – Timothy Martin
            Feb 1 '17 at 23:51











          • When I try adding parameters, they all give invalid option errors, but the 'user' option does NOT generate an invalid option error

            – TSG
            Feb 2 '17 at 1:06











          • See @Adonis' answer for why user= exists

            – Ryan V. Bissell
            Apr 20 '18 at 21:58



















          1














          The user option is related to allow any users on your system allowed to mount the file system. See the "non-superuser mounts" of man mount






          share|improve this answer































            0















            sudo mount -t nfs -O user=root,pass=mypass lserver:/root /mnt/d0




            Notice that the 'O' is a capital letter.






            share|improve this answer































              -1














              This works under CentOS



              mount.cifs //192.168.0.123/myshare /mnt/myshare -o user=myuser


              (it asks for the password - you can add it on the commandline probably via pass=)



              Run this by itself to see all the options:



              mount.cifs



              Usage: mount.cifs -o



              Mount the remote target, specified as a UNC name, to a local
              directory.



              Options:
              user=
              pass=
              dom=



              Less commonly used options:
              credentials=,guest,perm,noperm,setuids,nosetuids,rw,ro,
              sep=,iocharset=,suid,nosuid,exec,noexec,serverino,
              mapchars,nomapchars,nolock,servernetbiosname=
              directio,nounix,cifsacl,sec=,sign,fsc



              Options not needed for servers supporting CIFS Unix extensions
              (e.g. unneeded for mounts to most Samba versions):
              uid=,gid=,dir_mode=,file_mode=,sfu



              Rarely used options:
              port=,rsize=,wsize=,unc=,ip=,
              dev,nodev,nouser_xattr,netbiosname=,hard,soft,intr,
              nointr,ignorecase,noposixpaths,noacl,prefixpath=,nobrl



              Options are described in more detail in the manual page
              man 8 mount.cifs



              To display the version number of the mount helper:
              mount.cifs -V







              share|improve this answer























                Your Answer








                StackExchange.ready(function() {
                var channelOptions = {
                tags: "".split(" "),
                id: "106"
                };
                initTagRenderer("".split(" "), "".split(" "), channelOptions);

                StackExchange.using("externalEditor", function() {
                // Have to fire editor after snippets, if snippets enabled
                if (StackExchange.settings.snippets.snippetsEnabled) {
                StackExchange.using("snippets", function() {
                createEditor();
                });
                }
                else {
                createEditor();
                }
                });

                function createEditor() {
                StackExchange.prepareEditor({
                heartbeatType: 'answer',
                autoActivateHeartbeat: false,
                convertImagesToLinks: false,
                noModals: true,
                showLowRepImageUploadWarning: true,
                reputationToPostImages: null,
                bindNavPrevention: true,
                postfix: "",
                imageUploader: {
                brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                allowUrls: true
                },
                onDemand: true,
                discardSelector: ".discard-answer"
                ,immediatelyShowMarkdownHelp:true
                });


                }
                });














                draft saved

                draft discarded


















                StackExchange.ready(
                function () {
                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f341854%2ffailed-to-pass-credentials-to-nfs-mount%23new-answer', 'question_page');
                }
                );

                Post as a guest















                Required, but never shown

























                4 Answers
                4






                active

                oldest

                votes








                4 Answers
                4






                active

                oldest

                votes









                active

                oldest

                votes






                active

                oldest

                votes









                11














                Specifying username and password are options for cifs (samba), but not nfs. According to this CentOS Documentation:




                NFS controls who can mount an exported file system based on the host making the mount request, not the user that actually uses the file system. Hosts must be given explicit rights to mount the exported file system. Access control is not possible for users, other than through file and directory permissions.







                share|improve this answer
























                • I missed that! But why is 'user' a valid parameter for NFS mounts?

                  – TSG
                  Feb 1 '17 at 23:44






                • 1





                  Where do you see that? There is no user option in man mount.nfs.

                  – Timothy Martin
                  Feb 1 '17 at 23:51











                • When I try adding parameters, they all give invalid option errors, but the 'user' option does NOT generate an invalid option error

                  – TSG
                  Feb 2 '17 at 1:06











                • See @Adonis' answer for why user= exists

                  – Ryan V. Bissell
                  Apr 20 '18 at 21:58
















                11














                Specifying username and password are options for cifs (samba), but not nfs. According to this CentOS Documentation:




                NFS controls who can mount an exported file system based on the host making the mount request, not the user that actually uses the file system. Hosts must be given explicit rights to mount the exported file system. Access control is not possible for users, other than through file and directory permissions.







                share|improve this answer
























                • I missed that! But why is 'user' a valid parameter for NFS mounts?

                  – TSG
                  Feb 1 '17 at 23:44






                • 1





                  Where do you see that? There is no user option in man mount.nfs.

                  – Timothy Martin
                  Feb 1 '17 at 23:51











                • When I try adding parameters, they all give invalid option errors, but the 'user' option does NOT generate an invalid option error

                  – TSG
                  Feb 2 '17 at 1:06











                • See @Adonis' answer for why user= exists

                  – Ryan V. Bissell
                  Apr 20 '18 at 21:58














                11












                11








                11







                Specifying username and password are options for cifs (samba), but not nfs. According to this CentOS Documentation:




                NFS controls who can mount an exported file system based on the host making the mount request, not the user that actually uses the file system. Hosts must be given explicit rights to mount the exported file system. Access control is not possible for users, other than through file and directory permissions.







                share|improve this answer













                Specifying username and password are options for cifs (samba), but not nfs. According to this CentOS Documentation:




                NFS controls who can mount an exported file system based on the host making the mount request, not the user that actually uses the file system. Hosts must be given explicit rights to mount the exported file system. Access control is not possible for users, other than through file and directory permissions.








                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Feb 1 '17 at 23:14









                Timothy MartinTimothy Martin

                5,2942229




                5,2942229













                • I missed that! But why is 'user' a valid parameter for NFS mounts?

                  – TSG
                  Feb 1 '17 at 23:44






                • 1





                  Where do you see that? There is no user option in man mount.nfs.

                  – Timothy Martin
                  Feb 1 '17 at 23:51











                • When I try adding parameters, they all give invalid option errors, but the 'user' option does NOT generate an invalid option error

                  – TSG
                  Feb 2 '17 at 1:06











                • See @Adonis' answer for why user= exists

                  – Ryan V. Bissell
                  Apr 20 '18 at 21:58



















                • I missed that! But why is 'user' a valid parameter for NFS mounts?

                  – TSG
                  Feb 1 '17 at 23:44






                • 1





                  Where do you see that? There is no user option in man mount.nfs.

                  – Timothy Martin
                  Feb 1 '17 at 23:51











                • When I try adding parameters, they all give invalid option errors, but the 'user' option does NOT generate an invalid option error

                  – TSG
                  Feb 2 '17 at 1:06











                • See @Adonis' answer for why user= exists

                  – Ryan V. Bissell
                  Apr 20 '18 at 21:58

















                I missed that! But why is 'user' a valid parameter for NFS mounts?

                – TSG
                Feb 1 '17 at 23:44





                I missed that! But why is 'user' a valid parameter for NFS mounts?

                – TSG
                Feb 1 '17 at 23:44




                1




                1





                Where do you see that? There is no user option in man mount.nfs.

                – Timothy Martin
                Feb 1 '17 at 23:51





                Where do you see that? There is no user option in man mount.nfs.

                – Timothy Martin
                Feb 1 '17 at 23:51













                When I try adding parameters, they all give invalid option errors, but the 'user' option does NOT generate an invalid option error

                – TSG
                Feb 2 '17 at 1:06





                When I try adding parameters, they all give invalid option errors, but the 'user' option does NOT generate an invalid option error

                – TSG
                Feb 2 '17 at 1:06













                See @Adonis' answer for why user= exists

                – Ryan V. Bissell
                Apr 20 '18 at 21:58





                See @Adonis' answer for why user= exists

                – Ryan V. Bissell
                Apr 20 '18 at 21:58













                1














                The user option is related to allow any users on your system allowed to mount the file system. See the "non-superuser mounts" of man mount






                share|improve this answer




























                  1














                  The user option is related to allow any users on your system allowed to mount the file system. See the "non-superuser mounts" of man mount






                  share|improve this answer


























                    1












                    1








                    1







                    The user option is related to allow any users on your system allowed to mount the file system. See the "non-superuser mounts" of man mount






                    share|improve this answer













                    The user option is related to allow any users on your system allowed to mount the file system. See the "non-superuser mounts" of man mount







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Mar 20 '17 at 15:40









                    AdonisAdonis

                    1444




                    1444























                        0















                        sudo mount -t nfs -O user=root,pass=mypass lserver:/root /mnt/d0




                        Notice that the 'O' is a capital letter.






                        share|improve this answer




























                          0















                          sudo mount -t nfs -O user=root,pass=mypass lserver:/root /mnt/d0




                          Notice that the 'O' is a capital letter.






                          share|improve this answer


























                            0












                            0








                            0








                            sudo mount -t nfs -O user=root,pass=mypass lserver:/root /mnt/d0




                            Notice that the 'O' is a capital letter.






                            share|improve this answer














                            sudo mount -t nfs -O user=root,pass=mypass lserver:/root /mnt/d0




                            Notice that the 'O' is a capital letter.







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Jan 16 at 19:51









                            user221488user221488

                            1




                            1























                                -1














                                This works under CentOS



                                mount.cifs //192.168.0.123/myshare /mnt/myshare -o user=myuser


                                (it asks for the password - you can add it on the commandline probably via pass=)



                                Run this by itself to see all the options:



                                mount.cifs



                                Usage: mount.cifs -o



                                Mount the remote target, specified as a UNC name, to a local
                                directory.



                                Options:
                                user=
                                pass=
                                dom=



                                Less commonly used options:
                                credentials=,guest,perm,noperm,setuids,nosetuids,rw,ro,
                                sep=,iocharset=,suid,nosuid,exec,noexec,serverino,
                                mapchars,nomapchars,nolock,servernetbiosname=
                                directio,nounix,cifsacl,sec=,sign,fsc



                                Options not needed for servers supporting CIFS Unix extensions
                                (e.g. unneeded for mounts to most Samba versions):
                                uid=,gid=,dir_mode=,file_mode=,sfu



                                Rarely used options:
                                port=,rsize=,wsize=,unc=,ip=,
                                dev,nodev,nouser_xattr,netbiosname=,hard,soft,intr,
                                nointr,ignorecase,noposixpaths,noacl,prefixpath=,nobrl



                                Options are described in more detail in the manual page
                                man 8 mount.cifs



                                To display the version number of the mount helper:
                                mount.cifs -V







                                share|improve this answer




























                                  -1














                                  This works under CentOS



                                  mount.cifs //192.168.0.123/myshare /mnt/myshare -o user=myuser


                                  (it asks for the password - you can add it on the commandline probably via pass=)



                                  Run this by itself to see all the options:



                                  mount.cifs



                                  Usage: mount.cifs -o



                                  Mount the remote target, specified as a UNC name, to a local
                                  directory.



                                  Options:
                                  user=
                                  pass=
                                  dom=



                                  Less commonly used options:
                                  credentials=,guest,perm,noperm,setuids,nosetuids,rw,ro,
                                  sep=,iocharset=,suid,nosuid,exec,noexec,serverino,
                                  mapchars,nomapchars,nolock,servernetbiosname=
                                  directio,nounix,cifsacl,sec=,sign,fsc



                                  Options not needed for servers supporting CIFS Unix extensions
                                  (e.g. unneeded for mounts to most Samba versions):
                                  uid=,gid=,dir_mode=,file_mode=,sfu



                                  Rarely used options:
                                  port=,rsize=,wsize=,unc=,ip=,
                                  dev,nodev,nouser_xattr,netbiosname=,hard,soft,intr,
                                  nointr,ignorecase,noposixpaths,noacl,prefixpath=,nobrl



                                  Options are described in more detail in the manual page
                                  man 8 mount.cifs



                                  To display the version number of the mount helper:
                                  mount.cifs -V







                                  share|improve this answer


























                                    -1












                                    -1








                                    -1







                                    This works under CentOS



                                    mount.cifs //192.168.0.123/myshare /mnt/myshare -o user=myuser


                                    (it asks for the password - you can add it on the commandline probably via pass=)



                                    Run this by itself to see all the options:



                                    mount.cifs



                                    Usage: mount.cifs -o



                                    Mount the remote target, specified as a UNC name, to a local
                                    directory.



                                    Options:
                                    user=
                                    pass=
                                    dom=



                                    Less commonly used options:
                                    credentials=,guest,perm,noperm,setuids,nosetuids,rw,ro,
                                    sep=,iocharset=,suid,nosuid,exec,noexec,serverino,
                                    mapchars,nomapchars,nolock,servernetbiosname=
                                    directio,nounix,cifsacl,sec=,sign,fsc



                                    Options not needed for servers supporting CIFS Unix extensions
                                    (e.g. unneeded for mounts to most Samba versions):
                                    uid=,gid=,dir_mode=,file_mode=,sfu



                                    Rarely used options:
                                    port=,rsize=,wsize=,unc=,ip=,
                                    dev,nodev,nouser_xattr,netbiosname=,hard,soft,intr,
                                    nointr,ignorecase,noposixpaths,noacl,prefixpath=,nobrl



                                    Options are described in more detail in the manual page
                                    man 8 mount.cifs



                                    To display the version number of the mount helper:
                                    mount.cifs -V







                                    share|improve this answer













                                    This works under CentOS



                                    mount.cifs //192.168.0.123/myshare /mnt/myshare -o user=myuser


                                    (it asks for the password - you can add it on the commandline probably via pass=)



                                    Run this by itself to see all the options:



                                    mount.cifs



                                    Usage: mount.cifs -o



                                    Mount the remote target, specified as a UNC name, to a local
                                    directory.



                                    Options:
                                    user=
                                    pass=
                                    dom=



                                    Less commonly used options:
                                    credentials=,guest,perm,noperm,setuids,nosetuids,rw,ro,
                                    sep=,iocharset=,suid,nosuid,exec,noexec,serverino,
                                    mapchars,nomapchars,nolock,servernetbiosname=
                                    directio,nounix,cifsacl,sec=,sign,fsc



                                    Options not needed for servers supporting CIFS Unix extensions
                                    (e.g. unneeded for mounts to most Samba versions):
                                    uid=,gid=,dir_mode=,file_mode=,sfu



                                    Rarely used options:
                                    port=,rsize=,wsize=,unc=,ip=,
                                    dev,nodev,nouser_xattr,netbiosname=,hard,soft,intr,
                                    nointr,ignorecase,noposixpaths,noacl,prefixpath=,nobrl



                                    Options are described in more detail in the manual page
                                    man 8 mount.cifs



                                    To display the version number of the mount helper:
                                    mount.cifs -V








                                    share|improve this answer












                                    share|improve this answer



                                    share|improve this answer










                                    answered Jun 21 '18 at 3:55









                                    Anon CowardAnon Coward

                                    62




                                    62






























                                        draft saved

                                        draft discarded




















































                                        Thanks for contributing an answer to Unix & Linux Stack Exchange!


                                        • Please be sure to answer the question. Provide details and share your research!

                                        But avoid



                                        • Asking for help, clarification, or responding to other answers.

                                        • Making statements based on opinion; back them up with references or personal experience.


                                        To learn more, see our tips on writing great answers.




                                        draft saved


                                        draft discarded














                                        StackExchange.ready(
                                        function () {
                                        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f341854%2ffailed-to-pass-credentials-to-nfs-mount%23new-answer', 'question_page');
                                        }
                                        );

                                        Post as a guest















                                        Required, but never shown





















































                                        Required, but never shown














                                        Required, but never shown












                                        Required, but never shown







                                        Required, but never shown

































                                        Required, but never shown














                                        Required, but never shown












                                        Required, but never shown







                                        Required, but never shown







                                        Popular posts from this blog

                                        How to make a Squid Proxy server?

                                        Is this a new Fibonacci Identity?

                                        Touch on Surface Book