Windows 7 - Samba Shares - multiple credentials

5,540

Solution 1

Following the answers here Samba+Windows: Allow multiple connections by different users?, I figured there is no solution from the windows client.

So I added several aliases to my linux server: /etc/samba/smb.conf

[global]
    unix extensions = no
    netbios aliases = ALIAS1 ALIAS2 ALIAS3
    wide links = yes
    workgroup = WORKGROUP
    os level = 20
    follow symlinks = yes
    wins support = true

then I connected to each alias with a differenet user & password.

Solution 2

I realize this is old, but I ran into a similar issue. I found that I could fix it by setting the folder as a public share, but then also adding access for the users who were already set up with other folders.

My setup (for public share in /etc/samba/smb.conf):

[Share]
    comment = Public Share
    path = /path/to/target/folder
    available = yes
    browsable = yes
    writeable = no
    public = yes
    valid users = user1 user2 user3 # These users are set up with their own shares

This way the authorized users can use their credentials to access the public folder.

EDIT: So I am learning my way around this site, and of course still around Linux, and apparently Windows!

After setting things up as above and seeming to have everything working properly, my in-laws brought their laptop, which I did some work on and then used to check my network share settings. I was kinda right. So since then I've done some more testing.

My final settings for public share are:

[share]
comment = Public Share
path = /path/to/public/share
guest ok = yes
guest account = nobody
browsable = yes
writeable = no
public = yes

Of course Ubuntu (20.04) lets me mount my private and public shares independently with no questions asked other than for passwords for the private shares.

Windows 7 seems to let me mount both public and private either in that order or reverse. (Public, then private, or private, then public.) It seems that if my username and password are the same for the Win7 account as for the SAMBA share account, it will log me right in to the matching private share. (Confirmed by attempting to open a share that isn't mine, and it asked for credentials.)

Windows 10 on the other hand, will only allow both shares mounted if the private share is mounted first. At least the first time, or for random mounts. If the private share's password is saved and both shares are set to "mount at login", it seems to work smoothly.

Share:
5,540
chickenchaser
Author by

chickenchaser

Eager learner. Developing the FOSS project eLibrary

Updated on September 18, 2022

Comments

  • chickenchaser
    chickenchaser over 1 year

    My home setup has a Linux server which serves several shares, each with a different user & password.

    I.e.: public, user1, user2

    I can connect to my shares individually via \\server\public with the user & password.

    However, once I entered credentials for one of the shares, it seems I can't access any of the other shares on the same machine.

    Is there a way around this?

    • Admin
      Admin over 12 years
      Is there a particular reason you don't want to create an additional user that has access to multiple shares? Also, are you mounting through explorer or using command line (e.g., net use)
    • Admin
      Admin over 12 years
      There is a specific reason. One share is public for all of the house guests (e.g. public), and others are private (user specific). Explorer uses the same windows resources as net use so there won't be any difference there. (And I tested to make sure of that)
    • Admin
      Admin over 12 years
      My samba config has several users for different shares. That one works fine when i login each time with a different user from my client pc. but once i logged in, I cant log to another share with different credentials.
  • Dave M
    Dave M about 4 years
    It seems you may be attempting to edit this with a second account bracham rather than Bracham Holfeld If that is the case, the accounts should be merged superuser.com/help/merging-accounts
  • bracham
    bracham about 4 years
    Thank you Dave! That was much easier than I expected!