Windows 7 - Samba Shares - multiple credentials

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.