Announcement

Collapse
No announcement yet.

SMB - denied access

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    SMB - denied access

    so, i wiped out and created a new Kubuntu 12.04 64bit VM. fresh install with all the latest updates.

    shared out a folder on a different hard drive (/media/Music) - the folder is called music, so the full path is '/media/Music/music').

    when i browse my network, it does see the SMB server and the shared folder (music). when i attempt to access the 'music' shared folder, i get an error message stating that i do not have permission to access the folder.

    i tried sharing the folder via Dolphin, but the settings never stick - and i cannot access the folder.

    so, i edited the smb.conf file as follows:

    -----

    [global]

    vfs objects = dirsort

    [music]

    comment = music
    path = /media/Music/music
    read only = No

    -----

    admittedly, i have no idea if i put the file share in the correct location within the smb.conf file.

    i did already run the 'sudo smbpasswd -a <username>' command and verified that the password on my SMB server is the same password as my Win7 desktop.

    so, i am a bit lost. i've been reading the sections of my 'using samba (third edition)' book, but obviously, i'm still very new to this...

    #2
    Here's a stanza from my smb.conf, although it's a bit dated. My server is running 10.04.4 Ubuntu and Samba 3.4.7"

    [shared]
    path = /mnt/shared
    comment = Shared Files
    browsable = yes
    public = yes
    writable = yes
    inherit permissions = 0755
    create mask = 0755
    security mask = 0755
    security = share
    guest ok = yes

    If I recall, there are issues accessing samba with Win7. You might want to search the Windows forums.

    Please Read Me

    Comment


      #3
      Here's something I found:

      To get Windows 7 clients to connect to the domain running Samba 3.3.4 or higher, four registry keys need to be changed. For the ones that don't exist, create them.
      Two dword keys within HKEY_LOCAL_MACHINESYSTEMCurrentControlSetservicesL anmanWorkstationParameters:
      "DomainCompatibilityMode" = 1
      "DNSNameResolutionRequired" = 0

      And two within HKEY_LOCAL_MACHINESYSTEMCurrentControlSetservicesN etlogonParameters:
      "RequireSignOnSeal" = 0
      "RequireStrongKey" = 0

      After setting these, you should be able to join the machine to the existing Samba-run domain. Again, this is assuming you're working in an already-working environment. Configuring Samba to act as a domain controller is covered in the article, Build a Primary Domain Controller With Samba.

      Please Read Me

      Comment


        #4
        /media is typically used by the OS for connecting removable drives. If it is not inconsistent with your intentions for the shared music, I would suggest making a /mnt/MUSIC folder, mount the shared partition to that, and then use Alt-F2 "kdesu dolphin" to set that /mnt/Music folder to be shared, with an appropriate owner (nobody?) and group (users?) for your setup. That should keep the sharing and permissions permanently.

        Comment


          #5
          just a quick (late) update.

          instead of hoking around with VMs, i fired up my Kubuntu 12.04 laptop, installed Samba and shared a folder with music files. i went through the process of updating the smbpasswd for my user account, so that my Win7 desktop and Kubuntu laptop had the same username/password - it worked!

          i verified that it has all the functionality that i require (i can edit, add, deleted, etc) all contents within the primary shared folder and all sub-folders. i then manually added the folder/content sorting option to the 'smb.conf' as well. everything worked perfectly!

          needless to say, i am a happy guy! and will be putting my Windows file server OS out to pasture soon, and replacing it with Kubuntu 12.04!

          i did have a bit of apprehension as i could not find a good remote (GUI based) management tool, but found that TeamViewer does it perfectly!

          so, really, everything is basically sorted out.


          Originally posted by dibl View Post
          /media is typically used by the OS for connecting removable drives. If it is not inconsistent with your intentions for the shared music, I would suggest making a /mnt/MUSIC folder, mount the shared partition to that, and then use Alt-F2 "kdesu dolphin" to set that /mnt/Music folder to be shared, with an appropriate owner (nobody?) and group (users?) for your setup. That should keep the sharing and permissions permanently.
          i did not have an option of where the mounting point would be - the drawback of GUI based partition tools i am guessing or perhaps just using the wrong one.

          any recommendations?

          Comment


            #6
            and now that i've built a dedicated Kubuntu file server, i am getting the following error code "0x80070043" when connecting from my Win7 desktop. i also get prompted for username/password from my Kubuntu laptop - no matter how many times i type in the correct username/password sequence.

            i've already done a number of small changes - and tested after each. the results have been annoying. :/ either the error message above OR a bland 'access denied' message.

            this file server (which i am posting from) was a fresh install, that was performed and updated earlier today. so, i am a bit at a loss. the biggest impact at the moment is the lack of music being played while i sleep (required for restful sleep).

            i will have time tomorrow to do further testing, and if anyone has any ideas at all, please share. i'll post all my results.

            ----

            here is an example of the share that i've setup in the 'smb.conf' file:

            [global]

            vfs objects = dirsort
            netbios name = server

            [Music]
            comment = Music
            public = yes
            create mask = 0777
            directory mask = 0777
            path = /media/music/music
            writeable = yes
            browseable = yes
            Last edited by not12listen; Sep 09, 2012, 01:00 AM.

            Comment


              #7
              and now, something else to throw into the mix. i've added a 3TB hard drive. it is too large for a single EXT4 partition, but i can make 2 small partitions (2TB, and 1TB respectively). i've looked into the 'fstab' and neither are listed.

              i do not know if the 2 other partitions must also be listed within 'fstab' in order for this to work correctly. so, i am hoping that someone can clue me in.

              ----

              did some more testing. created a share on the main hard drive called 'test' - it works perfectly.

              also, i did find out how to edit the 'fstab' with the correct information - much easier than i expected.

              still no go.

              so, the problem i am having is specifically when i try to access a share that i've created that is NOT on the original hard drive that was present during the installation of Kubuntu.

              so... yeah. anyone ever heard of that?
              Last edited by not12listen; Sep 09, 2012, 01:40 AM.

              Comment


                #8
                so. i did get it worked out. lots of searching (on google) and reading.

                had to use GParted to correctly create the partition of my 3TB hard drive.
                edit 'fstab' to verify that the partition was listed correctly for auto mounting.
                had to 'chown' the partition.
                had to 'chmod' the partition, so that all users could get access to it correctly.
                re-edited my 'smb.conf' file with the updated partition location.
                then re-did 'smbpasswd' for the 2 user accounts.

                whew...! everything worked perfectly earlier this morning (currently 10:19PST). but, at the moment, i am getting yet 'you need permission' to get into the music share - the 2 other shares are working perfectly.

                more troubleshooting, but i've made a lot of progress.

                Comment


                  #9
                  Here's how I do it:

                  1. sudo mkdir -p /mnt/DATA
                  2. sudo mount -t ext4 /dev/sdxy /mnt/DATA (mount your data partition(s)/drive(s) to /mnt/DATA
                  3. sudo mkdir -p /mnt/DATA/MUSIC (VIDEOS, IMAGES, DOCS, etc. etc.)
                  4. Launch dolphin in root mode with Alt-F2 "kdesudo dolphin" and browse to /mnt/DATA
                  5. Open the properties tab, set user "nobody", group "users", and the permissions to read and write, and "x" the "Apply to subdirectories", and "Apply", and close dolphin.

                  Now you're ready to deal with samba. I turn off the Windows firewalls -- happily we're behind a router with its own firewall, so I can skip the grief on the Windows side. You do need to use a Windows login for the Windows user (on the Windows machine), or they won't be able to log in to the samba share. You need the smbd and nmbd services running. There are a zillion examples of smb.conf files out there, so I won't post mine here.

                  Comment


                    #10
                    just double checked the permissions on the specific shared folders (within Dolphin) - the 2 user accounts were NOT present. i added them.

                    it works! already tested it from my Win7 desktop - perfecto!

                    and now begins the process of transferring the rest of the data onto EXT4 spindles... whee!

                    ----

                    btw - i got the idea to double check the folder permissions from your most recent post dibl, so thanks for the memory jog.

                    Comment


                      #11
                      Originally posted by dibl View Post
                      Here's how I do it:

                      1. sudo mkdir -p /mnt/DATA
                      2. sudo mount -t ext4 /dev/sdxy /mnt/DATA (mount your data partition(s)/drive(s) to /mnt/DATA
                      3. sudo mkdir -p /mnt/DATA/MUSIC (VIDEOS, IMAGES, DOCS, etc. etc.)
                      4. Launch dolphin in root mode with Alt-F2 "kdesudo dolphin" and browse to /mnt/DATA
                      5. Open the properties tab, set user "nobody", group "users", and the permissions to read and write, and "x" the "Apply to subdirectories", and "Apply", and close dolphin.

                      Now you're ready to deal with samba. I turn off the Windows firewalls -- happily we're behind a router with its own firewall, so I can skip the grief on the Windows side. You do need to use a Windows login for the Windows user (on the Windows machine), or they won't be able to log in to the samba share. You need the smbd and nmbd services running. There are a zillion examples of smb.conf files out there, so I won't post mine here.
                      not quite sure why, but now i cannot create folders. annoying.

                      username/password are verified to be identical.

                      i'll try your method later this evening and post my results. i hope this fixes it.

                      Comment


                        #12
                        i've not gone through the steps you've outlined, dibl...

                        just fyi, here is the error i am getting now. just a WHEE bit frustrating.



                        tomorrow, when i get actual time, i'll work on this a bit more. just hoping for a bit of input.

                        Comment


                          #13
                          and now i am REALLY confused... everything is working perfectly. no errors, no problems, no issues.

                          (scratches head)

                          yeah.

                          Comment


                            #14
                            after a bit more troubleshooting, i'm getting really keen on finding the fix pretty quickly.

                            i'll post my notes this evening, but the basics are:
                            install samba / create partition / edit fstab / take ownership (if necessary) of partition / create folder(s) / copy over contents from previous hard drive / CHOWN and CHMOD folders / edit smb.conf / enjoy!

                            but, honestly, this can be marked as solved.

                            Comment


                              #15
                              so, i FINALLY have a few moments in which i can post the steps to the entire process...


                              sudo apt-get install samba (did this inside Dolphin, so if the command is incorrect, my apologies)

                              had to run sudo fdisk from the terminal in order to change my 3TB drive from 'mbr' type to 'gpt' type - otherwise, i was stuck with a 2.2TB partition instead of using the full 3TB.

                              sudo apt-get install gparted (found it to be a more useful partitioning software than the default)

                              sudo blkid (to get the GUID of each partition)

                              create/copy contents from source partition/folder to destination partition/folder.

                              sudo nano /etc/fstab (add in the GUID of the partitions that you want auto mounted)

                              sudo chown -R kubuntu:kubuntu /media/stuff (kubuntu is the name of a local account with basic rights / stuff is the name of the partition that i created)

                              sudo chmod -R 0777 /media/stuff (take ownership of the 'stuff' partition and give full control rights to all users)

                              sudo nano /etc/samba/smb.conf
                              [global]

                              vfs objects = dirsort
                              netbios name = server
                              security = user
                              encrypt passwords = yes
                              passdb backend = smbpasswd

                              [Music]
                              comment = Music
                              path = /media/stuff/music
                              valid users = user, user, user
                              writeable = yes
                              browseable = yes
                              create mask = 0777
                              force group = kubuntu

                              --------

                              ok. so, that covers it pretty well. i'm sure i've forgotten some small details (such as the exact commands with FDISK). but, if anyone has any questions, i would be more than happy to assist or fill in the blanks.

                              and i just edited the document with the partitioning in the correct order.
                              Last edited by not12listen; Sep 19, 2012, 05:10 PM.

                              Comment

                              Working...
                              X