TransWikia.com

Samba with multiple shares from the same server

Unix & Linux Asked by s55michi on February 5, 2021

Windows 10:

I can’t open more than one share of a server. Windows returns an error that the resource is not accessible.

Example: I open up \raspberrypione. Now I try to open \raspberrypitwo and Windows returns an error.

It is possible to access a second share by calling the IP instead of the name. \raspberrypione & \192.168.0.5two are possible! A third share, either of the name or the IP, returns the same error.

smb.conf:

# Global parameters
[global]
   workgroup = WORKGROUP
   netbios name = raspberrypi
   server string = Samba Server %v
   log file = /var/log/samba/log.%m
   max log size = 50
   security = user
   encrypt passwords = yes
   vfs object = recycle
   recycle:maxsize = 0
[one]
   path = /mnt/library/one
   available = yes
   guest ok = no
   browsable = yes
   writeable = yes
   valid users = alice
   create mask = 0640
   directory mask = 0750
   force user = alice
[two]
   path = /mnt/library/two
   available = yes
   guest ok = no
   browsable = yes
   writeable = yes
   valid users = bob
   create mask = 0640
   directory mask = 0750
   force user = bob
[three]
   path = /mnt/library/three
   available = yes
   guest ok = no
   browsable = yes
   writeable = yes
   valid users = eve
   create mask = 0640
   directory mask = 0750
   force user = eve

All three shares are accessed with different Users & passwords.
Server is a RaspberryPi with a vfat HDD.

3 Answers

If this is a simple, fully controlled setup you can "trick" Windows by never using the IP of your pi as its share adress, but use hostnames instead.

For this edit the hosts file (please edit and include the path) and give it a separate name per share, e.g.

192.168.0.5 share1 share1
192.168.0.5 share2 share2
192.168.0.5 share3 share3

Then add shared drives in your win10 setup: \share1one, \share2two etc. Windows will identify these as different services (with one 'resource' each, called 'one', 'two' etc) and allow you to specify separate different credentials. PITA.

Answered by Felix on February 5, 2021

I found the answer. Seems like an authentication issue:

Please understand that this behavior is by design for security purpose, Windows only allow per user per SMB connect at a machine.

Answered by s55michi on February 5, 2021

Your problem is likely due to the different users and passwords. Windows associated the user with the host, not with the resource. So your trick of using the IP address directly made windows think it was a different host and allowed different credentials.

One work around could be to have your pi use an IP address per resource.

Answered by Stephen Rauch on February 5, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP