8

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?

4
  • 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) – Eric G Feb 16 '12 at 5:01
  • 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) – Am. Feb 16 '12 at 9:12
  • So, it should be mapped for each logged in user, its not that you want to map them all with the same windows account? If its one account to many shares, then you should be able to add additional permissions in your samba configuration. – Eric G Feb 16 '12 at 14:43
  • 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. – Am. Feb 16 '12 at 23:37
4

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.

1

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.

2
  • 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 – Dave M Apr 25 '20 at 11:38
  • Thank you Dave! That was much easier than I expected! – bracham Apr 26 '20 at 5:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.