Page 4 of 4 FirstFirst ... 234
Results 31 to 35 of 35

Thread: Cannot get Win 7 machine to connect to Samba share

  1. #31
    Join Date
    Nov 2014
    Beans
    21

    Re: Cannot get Win 7 machine to connect to Samba share

    I won't be able to reply for the next day and a bit so I'll post the results of what you've asked me to do when I get back. Thanks for the help so far!

  2. #32
    Join Date
    Nov 2014
    Beans
    21

    Re: Cannot get Win 7 machine to connect to Samba share

    nasadmin is a mortal user, I've set up the machine so that the user "generic" is automatically logged in at startup. I only have the "nasadmin" user created so that the "Other" directory is locked and cannot be accessed by anyone but nasadmin.

    So the smbusers file is just for converting usernames for when connecting from windows? If my understanding is correct then that may be what is causing the issue. I'll try deleting the file's contents to see if that has any effect.

    Both users (generic and nasadmin) have had Samba users created using "sudo smbpasswd -a".

    See below for results of the commands that you asked to be run:
    Code:
    generic@NewFishNAS ~ $ ls -l /media/generic
    total 8
    drwxrwxrwx 20 root    root    4096 Oct 26 19:00 Other
    drwxrwxrwx 10 generic generic 4096 Nov  6 23:16 RaidData
    generic@NewFishNAS ~ $ ls -l /media/generic/RaidData
    total 32
    drwxr-xr-x 26 generic generic 4096 Oct 26 13:37 Anime
    drwxr-xr-x  4 generic generic 4096 Oct 24 14:09 CloneZilla Backups
    -rw-r--r--  1 generic generic 2610 Nov  6 19:56 Forum post
    drwxr-xr-x 19 generic generic 4096 Oct 24 13:24 Games
    drwxr-xr-x  8 generic generic 4096 Oct 22 18:26 General Data
    drwxr-xr-x 74 generic generic 4096 Nov  7 13:44 Movies
    drwxr-xr-x 31 generic generic 4096 Oct 26 20:52 Music
    drwxr-xr-x 18 generic generic 4096 Oct 10 19:47 TV Series
    ls -l /media/generic/Other
    total 92
    drwxrwxrwx  4 generic generic  4096 Oct 12 14:10 *
    drwxrwxrwx  5 generic generic  4096 Oct 12 14:04 *
    drwxrwxrwx  3 generic generic  4096 Oct 12 15:16 *
    drwxrwxrwx  5 generic generic  4096 Oct 12 14:01 *
    drwxrwxrwx  4 generic generic 12288 Oct 12 15:06 *
    drwxrwxrwx  3 generic generic  4096 Oct 12 14:02 *
    drwxrwxrwx  3 generic generic  4096 Oct 12 15:16 *
    drwxrwxrwx  2 generic generic  4096 Oct 22 17:41 *
    drwxrwxrwx  2 root    root    16384 Oct 10 00:41 lost+found
    drwxrwxrwx 12 generic generic  4096 Oct 22 21:17 Misc
    drwxrwxrwx  3 generic generic  4096 Oct 12 15:18 Network Trash Folder
    drwxrwxrwx  5 generic generic  4096 Oct 12 14:01 *
    drwxrwxrwx  4 generic generic  4096 Oct 12 14:06 *
    drwxrwxrwx  3 generic generic  4096 Oct 12 15:16 *
    drwxrwxrwx  3 generic generic  4096 Oct 12 15:06 *
    drwxrwxrwx 52 generic generic  4096 Oct 26 19:00 *
    drwxrwxrwx  3 generic generic  4096 Oct 12 15:16 *
    (I'd rather not post the actual names of the folders in Other)

    EDIT: Clearing the smbusers file did nothing, however now when I try and access the Data share (/media/generic/RaidData) it says "unknown username or password" and prompts for me to enter credentials. Entering workgroup\generic allows me access even though that share has "force user = generic" specified as an option. Weird...
    Last edited by Mark_Fish; November 8th, 2014 at 06:34 AM.

  3. #33
    Join Date
    May 2008
    Location
    SoCal
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Cannot get Win 7 machine to connect to Samba share

    Quote Originally Posted by Mark_Fish View Post
    nasadmin is a mortal user. I've set up the machine so that the user "generic" is automatically logged in at startup.
    Does the user generic have an Ubuntu password at all.
    I only have the "nasadmin" user created so that the "Other" directory is locked and cannot be accessed by anyone but nasadmin.
    This doesn't seem quite right. The directory is open to all users as shown in red
    Code:
    drwxrwxrwx 20 root    root    4096 Oct 26 19:00 Other
    The red is the others group which is by definition "all other users on this host" There is no Samba share authentication at this level based on your posted smb.conf file.
    So the smbusers file is just for converting usernames for when connecting from windows? If my understanding is correct then that may be what is causing the issue. I'll try deleting the file's contents to see if that has any effect.
    The smbusers file is used when you need to map a Windows user with a different username to a Linux user. If the username is the same Linux Windows and Samba then you don't need the file mapping at all. Just as @morbius has said.
    Both users (generic and nasadmin) have had Samba users created using "sudo smbpasswd -a".
    Some how I'm missing what you are trying to do here. The [Data] share with the directory: /media/generic/RaidData is setup as a guest share (any Samba user has access (no authentication))
    Code:
    [Data]
        comment = All Data on the NAS
        path = /media/generic/RaidData
        read only = no
        writeable = yes
        browseable = yes
        guest ok = yes
        public = yes
        force user = generic
    ;    valid users = generic
    ...The guest ok =yes means no prompt for access. The directory that is shared has Linux authorization (permissions) for the user generic only.

    All users are authenticated as the user nobody which is why you have to use the force user = generic parameter. If you truly want only the user generic authenticated get rid of the guest user = ok and the public = ok which is a synonym for guest ok anyway. In their place uncomment the valid users = generic. This makes the prompt come up and the only Samba user that is authorized is the user generic. The Linux directory permissions authorize the Linux user generic to read and write to the directory. This means the Samba user generic is only authenticated (who are you) and the Linux user generic is authorized (has permissions)> This is why it's a good habit for the user names to be the same. It just makes it simpler. In any case a share that restricts what user should use it should not use the guest parameter.
    [QUOTE]

    See below for results of the commands that you asked to be run:
    Code:
    generic@NewFishNAS ~ $ ls -l /media/generic
    total 8
    drwxrwxrwx 20 root    root    4096 Oct 26 19:00 Other
    drwxrwxrwx 10 generic generic 4096 Nov  6 23:16 RaidData
    generic@NewFishNAS ~ $ ls -l /media/generic/RaidData
    total 32
    drwxr-xr-x 26 generic generic 4096 Oct 26 13:37 Anime
    drwxr-xr-x  4 generic generic 4096 Oct 24 14:09 CloneZilla Backups
    -rw-r--r--  1 generic generic 2610 Nov  6 19:56 Forum post
    drwxr-xr-x 19 generic generic 4096 Oct 24 13:24 Games
    drwxr-xr-x  8 generic generic 4096 Oct 22 18:26 General Data
    drwxr-xr-x 74 generic generic 4096 Nov  7 13:44 Movies
    drwxr-xr-x 31 generic generic 4096 Oct 26 20:52 Music
    drwxr-xr-x 18 generic generic 4096 Oct 10 19:47 TV Series
    ls -l /media/generic/Other
    total 92
    drwxrwxrwx  4 generic generic  4096 Oct 12 14:10 *
    drwxrwxrwx  5 generic generic  4096 Oct 12 14:04 *
    drwxrwxrwx  3 generic generic  4096 Oct 12 15:16 *
    drwxrwxrwx  5 generic generic  4096 Oct 12 14:01 *
    drwxrwxrwx  4 generic generic 12288 Oct 12 15:06 *
    drwxrwxrwx  3 generic generic  4096 Oct 12 14:02 *
    drwxrwxrwx  3 generic generic  4096 Oct 12 15:16 *
    drwxrwxrwx  2 generic generic  4096 Oct 22 17:41 *
    drwxrwxrwx  2 root    root    16384 Oct 10 00:41 lost+found
    drwxrwxrwx 12 generic generic  4096 Oct 22 21:17 Misc
    drwxrwxrwx  3 generic generic  4096 Oct 12 15:18 Network Trash Folder
    drwxrwxrwx  5 generic generic  4096 Oct 12 14:01 *
    drwxrwxrwx  4 generic generic  4096 Oct 12 14:06 *
    drwxrwxrwx  3 generic generic  4096 Oct 12 15:16 *
    drwxrwxrwx  3 generic generic  4096 Oct 12 15:06 *
    drwxrwxrwx 52 generic generic  4096 Oct 26 19:00 *
    drwxrwxrwx  3 generic generic  4096 Oct 12 15:16 *
    (I'd rather not post the actual names of the folders in Other)

    The [Other] share doesn't look right either for much the same reasons. See below in red
    Code:
    [Other$]
        comment = Hidden Stuff
        path = /media/generic/RaidData/Other$
        read only = no
        writeable = yes
        browseable = no
        valid users = fish
    In this case you have the user fish as the only authenticated user and some how that users authentication (user/pass) is not correct. I see the user in the pdbedit listing so I wonder if the password is incorrect. IMHO you should do a little house cleaning as all the user and groups are for the user generic on this share. Why is that. Have you thought of using a common group for this if you have two users using this share?
    -BAB1

  4. #34
    Join Date
    Nov 2014
    Beans
    21

    Re: Cannot get Win 7 machine to connect to Samba share

    The linux user "generic" does not have a password as it's meant to just be a user that anyone can use. The directory is currently open to all users because I was going to try and fix this connection problem first and then try and lock down the "Other" share. I have exactly the same issue when the permissions aren't "full access" to Others.

    The [Data] share is working as it should - from the windows machine the credentials aren't recognized so it defaults to guest. But then the user is forced to generic so that access permissions to files shouldn't be an issue. The [Data] share should be a guest share.

    Sorry, I've been changing so many different things so often to try and fix the problem that some of the thing's I've posted are no longer correct. The fish user was another user that I created (it is now deleted and the smb.conf file has been changed accordingly, valid users is now nasadmin instead). I only want nasadmin to be able to access the share.

    Did you want me to post the smb.conf as it is now?
    Last edited by Mark_Fish; November 8th, 2014 at 01:50 PM.

  5. #35
    Join Date
    Nov 2014
    Beans
    21

    Re: Cannot get Win 7 machine to connect to Samba share

    OK... So after messing around with some stuff I have now got the share to work... I checked the permissions of the path all the way from the bottom. It turns out the /media/generic folder has "no access" to users other than root. I've changed the permissions on the /media/generic folder from
    Code:
    drwxr-x---+ 2 root root 4096 Nov  8 22:44 generic
    to:
    Code:
    drwxr-xr-x+ 2 root root 4096 Nov  8 22:44 generic
    I then commented out the "force user = generic" and now the share works. I'm not sure gives the access denied error only when the user is forced to generic... Anyway, it looks like the issue is fixed. I'm just going to test everything to make sure it's all working then mark this thread as solved.

    Thank you both for all your help, you're both awesome

Page 4 of 4 FirstFirst ... 234

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •