Mount Samba Share(Linux server) on Linux client machine












1















There is Linux server that shares a folder with Windows client but there're also Linux client machines.
I am using KDE and can mount from Dolphin and then do with files and folders as permissions allows:



    smb://username@server_address/share_folder_name/


But i need to mount the way i can access it as a regular path(from console, LibreOffice, mail client etc) and on any DE.



    mkdir /media/sambaShare
smbclient --user=username -L //server_address


This part works, it shows me Samba server, what folder is shared etc.



    mount -t cifs //server_address/share_folder_name -o username=username /media/sambaShare


And it seems it mounts everything ok. But when i try to access the folder i get "cannot open directory /media/sambaShare/: Permission denied"



It allows accessing as root but not user. How come via Dolphin i can access as a user but regular way mounting doesn't work? I created the same group on client as in server that can access that folder and as user finally i could went into that folder and see other folders but no further. I can even add files but not edit them.



I'm using Samba Server 3.6.3 on Ubuntu server 12.04
Client machine Kubuntu 14.04










share|improve this question





























    1















    There is Linux server that shares a folder with Windows client but there're also Linux client machines.
    I am using KDE and can mount from Dolphin and then do with files and folders as permissions allows:



        smb://username@server_address/share_folder_name/


    But i need to mount the way i can access it as a regular path(from console, LibreOffice, mail client etc) and on any DE.



        mkdir /media/sambaShare
    smbclient --user=username -L //server_address


    This part works, it shows me Samba server, what folder is shared etc.



        mount -t cifs //server_address/share_folder_name -o username=username /media/sambaShare


    And it seems it mounts everything ok. But when i try to access the folder i get "cannot open directory /media/sambaShare/: Permission denied"



    It allows accessing as root but not user. How come via Dolphin i can access as a user but regular way mounting doesn't work? I created the same group on client as in server that can access that folder and as user finally i could went into that folder and see other folders but no further. I can even add files but not edit them.



    I'm using Samba Server 3.6.3 on Ubuntu server 12.04
    Client machine Kubuntu 14.04










    share|improve this question



























      1












      1








      1








      There is Linux server that shares a folder with Windows client but there're also Linux client machines.
      I am using KDE and can mount from Dolphin and then do with files and folders as permissions allows:



          smb://username@server_address/share_folder_name/


      But i need to mount the way i can access it as a regular path(from console, LibreOffice, mail client etc) and on any DE.



          mkdir /media/sambaShare
      smbclient --user=username -L //server_address


      This part works, it shows me Samba server, what folder is shared etc.



          mount -t cifs //server_address/share_folder_name -o username=username /media/sambaShare


      And it seems it mounts everything ok. But when i try to access the folder i get "cannot open directory /media/sambaShare/: Permission denied"



      It allows accessing as root but not user. How come via Dolphin i can access as a user but regular way mounting doesn't work? I created the same group on client as in server that can access that folder and as user finally i could went into that folder and see other folders but no further. I can even add files but not edit them.



      I'm using Samba Server 3.6.3 on Ubuntu server 12.04
      Client machine Kubuntu 14.04










      share|improve this question
















      There is Linux server that shares a folder with Windows client but there're also Linux client machines.
      I am using KDE and can mount from Dolphin and then do with files and folders as permissions allows:



          smb://username@server_address/share_folder_name/


      But i need to mount the way i can access it as a regular path(from console, LibreOffice, mail client etc) and on any DE.



          mkdir /media/sambaShare
      smbclient --user=username -L //server_address


      This part works, it shows me Samba server, what folder is shared etc.



          mount -t cifs //server_address/share_folder_name -o username=username /media/sambaShare


      And it seems it mounts everything ok. But when i try to access the folder i get "cannot open directory /media/sambaShare/: Permission denied"



      It allows accessing as root but not user. How come via Dolphin i can access as a user but regular way mounting doesn't work? I created the same group on client as in server that can access that folder and as user finally i could went into that folder and see other folders but no further. I can even add files but not edit them.



      I'm using Samba Server 3.6.3 on Ubuntu server 12.04
      Client machine Kubuntu 14.04







      linux samba






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 44 mins ago









      Rui F Ribeiro

      40.1k1479135




      40.1k1479135










      asked Aug 18 '15 at 12:31









      user2707431user2707431

      82




      82






















          1 Answer
          1






          active

          oldest

          votes


















          0














          You probably need to add the uid=your-user-id option to your mount command. You may also need to add forceuid to ignore the user IDs coming from the server (Samba offers a SMB extension to make Unix permissions work as expected; only Unix-like clients request it.) There are similar options for the group ID (gid & forcegid).



          Why? Since normal mounts are system-wide, your local kernel is enforcing permissions. Otherwise, any user on the system could access the share. The default, if you don't pass uid/gid is the user who ran mount—most likely root.



          See the mount.cifs man page for all the CIFS-specific mount options.






          share|improve this answer
























          • Thank you it worked! Didn't have to go as far as forcegid, passing uid & gid was enough.

            – user2707431
            Aug 18 '15 at 13:14











          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%2f223950%2fmount-samba-sharelinux-server-on-linux-client-machine%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          You probably need to add the uid=your-user-id option to your mount command. You may also need to add forceuid to ignore the user IDs coming from the server (Samba offers a SMB extension to make Unix permissions work as expected; only Unix-like clients request it.) There are similar options for the group ID (gid & forcegid).



          Why? Since normal mounts are system-wide, your local kernel is enforcing permissions. Otherwise, any user on the system could access the share. The default, if you don't pass uid/gid is the user who ran mount—most likely root.



          See the mount.cifs man page for all the CIFS-specific mount options.






          share|improve this answer
























          • Thank you it worked! Didn't have to go as far as forcegid, passing uid & gid was enough.

            – user2707431
            Aug 18 '15 at 13:14
















          0














          You probably need to add the uid=your-user-id option to your mount command. You may also need to add forceuid to ignore the user IDs coming from the server (Samba offers a SMB extension to make Unix permissions work as expected; only Unix-like clients request it.) There are similar options for the group ID (gid & forcegid).



          Why? Since normal mounts are system-wide, your local kernel is enforcing permissions. Otherwise, any user on the system could access the share. The default, if you don't pass uid/gid is the user who ran mount—most likely root.



          See the mount.cifs man page for all the CIFS-specific mount options.






          share|improve this answer
























          • Thank you it worked! Didn't have to go as far as forcegid, passing uid & gid was enough.

            – user2707431
            Aug 18 '15 at 13:14














          0












          0








          0







          You probably need to add the uid=your-user-id option to your mount command. You may also need to add forceuid to ignore the user IDs coming from the server (Samba offers a SMB extension to make Unix permissions work as expected; only Unix-like clients request it.) There are similar options for the group ID (gid & forcegid).



          Why? Since normal mounts are system-wide, your local kernel is enforcing permissions. Otherwise, any user on the system could access the share. The default, if you don't pass uid/gid is the user who ran mount—most likely root.



          See the mount.cifs man page for all the CIFS-specific mount options.






          share|improve this answer













          You probably need to add the uid=your-user-id option to your mount command. You may also need to add forceuid to ignore the user IDs coming from the server (Samba offers a SMB extension to make Unix permissions work as expected; only Unix-like clients request it.) There are similar options for the group ID (gid & forcegid).



          Why? Since normal mounts are system-wide, your local kernel is enforcing permissions. Otherwise, any user on the system could access the share. The default, if you don't pass uid/gid is the user who ran mount—most likely root.



          See the mount.cifs man page for all the CIFS-specific mount options.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Aug 18 '15 at 13:00









          derobertderobert

          73.9k8159212




          73.9k8159212













          • Thank you it worked! Didn't have to go as far as forcegid, passing uid & gid was enough.

            – user2707431
            Aug 18 '15 at 13:14



















          • Thank you it worked! Didn't have to go as far as forcegid, passing uid & gid was enough.

            – user2707431
            Aug 18 '15 at 13:14

















          Thank you it worked! Didn't have to go as far as forcegid, passing uid & gid was enough.

          – user2707431
          Aug 18 '15 at 13:14





          Thank you it worked! Didn't have to go as far as forcegid, passing uid & gid was enough.

          – user2707431
          Aug 18 '15 at 13:14


















          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%2f223950%2fmount-samba-sharelinux-server-on-linux-client-machine%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

          Accessing regular linux commands in Huawei's Dopra Linux

          Can't connect RFCOMM socket: Host is down

          Kernel panic - not syncing: Fatal Exception in Interrupt