Samba and Windows usernames ! (SOLVED)

Connection sharing, Firewall, Samba..etc
Forum rules
Before you post please read how to get help
acestu
Level 1
Level 1
Posts: 27
Joined: Fri Aug 11, 2017 3:24 pm

Samba and Windows usernames ! (SOLVED)

Postby acestu » Sun Aug 13, 2017 1:42 pm

Hi,

After setting up the latest version of Mint ie 18.2 and installing system-samba-config, I have set up a fileshare folder that thanks to Altair on here is now set with the right permissions, now if I set in Samba gui to allow anyone to read & write to the fileshare then with my windows 10 machine I can see the drive and successfully read & write the files, however if I use a name that I set up in Samba and is the same name as my windows user I get this message when I try to connect:

An error occurred while reconnecting Z: to \\MINTY-SERVER\Fileshares Microsoft Windows Network: The Local device name is already in use. This connection has not been restored.

Now I am thinking why has it not asked me for the Samba password that I set up ?

Do the Samba allowed users need to be listed in the smb.conf file also ?

I have trawled Youtube for a video on this but I can't seem to find anything about setting up the Windows end if you are using Samba names and passwords

As always any info is greatly appreciated
Thanks in advance
Stuart
Last edited by acestu on Sun Aug 13, 2017 4:00 pm, edited 1 time in total.

altair4
Level 18
Level 18
Posts: 8745
Joined: Tue Feb 03, 2009 10:27 am

Re: Samba and Windows usernames !

Postby altair4 » Sun Aug 13, 2017 1:52 pm

An error occurred while reconnecting Z: to \\MINTY-SERVER\Fileshares Microsoft Windows Network: The Local device name is already in use. This connection has not been restored.

One of the last advantages for me to continue to post in the Mint forum is that I get to see smb / samba error messages I've never seen before.

If I read that error message literally the issue is with "Z". It's already used or possibly mapped by another device on the WIn10 box.

You really need to tell people how you are set up. Posting the output of the following commands will tell us that:

Code: Select all

testparm -s

Code: Select all

net usershare info --long


Side note:
Now I am thinking why has it not asked me for the Samba password that I set up ?

Windows does something Samba would never do. When a Windows client accesses a SMB / Samba server it passes the local Windows user name and login password automatically without the users knowledge. If the same user exists on the Samba server and the samba password matches the Windows password credentials are automatically passed and verified so you don't need to get prompted.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.

acestu
Level 1
Level 1
Posts: 27
Joined: Fri Aug 11, 2017 3:24 pm

Re: Samba and Windows usernames !

Postby acestu » Sun Aug 13, 2017 2:04 pm

Hi Altair,

To the rescue again, I have done as you suggested and this is my output:

stuart@Minty-Server ~ $ testparm -s
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
WARNING: The "syslog" option is deprecated
Processing section "[printers]"
Processing section "[print$]"
Processing section "[Fileshares]"
Loaded services file OK.
Server role: ROLE_STANDALONE

# Global parameters
[global]
server string = %h server (Samba, Ubuntu)
server role = standalone server
map to guest = Bad User
obey pam restrictions = Yes
pam password change = Yes
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
unix password sync = Yes
syslog = 0
log file = /var/log/samba/log.%m
max log size = 1000
dns proxy = No
usershare allow guests = Yes
panic action = /usr/share/samba/panic-action %d
idmap config * : backend = tdb
force user = stuart


[printers]
comment = All Printers
path = /var/spool/samba
create mask = 0700
printable = Yes
browseable = No


[print$]
comment = Printer Drivers
path = /var/lib/samba/printers


[Fileshares]
comment = Test Folder
path = /home/stuart/Fileshares
valid users = stuart nobody acest
read only = No
create mask = 0770
stuart@Minty-Server ~ $ net usershare info --long
[Fileshares]
path=/home/stuart/Fileshares
comment=
usershare_acl=Everyone:F,
guest_ok=y

stuart@Minty-Server ~ $

Very intersting info about the passwords, does this mean that in my Samba users I need to have the same windows usernames and also their windows passwords ?

Thanks
Stuart

altair4
Level 18
Level 18
Posts: 8745
Joined: Tue Feb 03, 2009 10:27 am

Re: Samba and Windows usernames !

Postby altair4 » Sun Aug 13, 2017 2:33 pm

You can create a samba share two differnt ways:

[1] Samba Classic Share - it's share definition is in /etc/samba/smb.conf. You can edit smb.conf directly to do this or you can use something like system-config-samba. You have one of those:
[Fileshares]
comment = Test Folder
path = /home/stuart/Fileshares
valid users = stuart nobody acest
read only = No
create mask = 0770

[2] Samba Usershare - it's share definition is in /var/lib/samba/usershares and is normally created through the file manager. You have one of those as well:
[Fileshares]
path=/home/stuart/Fileshares
comment=
usershare_acl=Everyone:F,
guest_ok=y


You might see the problem here. 2 Shares, with the same label, pointing to the same folder, with different settings. The Classic Share only allows certain users. The Usershare allows everyone and your Aunt Tilly access.

I honestly have no idea which share definition Samba will obey. You can use both methods at the same time but not with the same label and not with different settings. Get rid of one or the other.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.

acestu
Level 1
Level 1
Posts: 27
Joined: Fri Aug 11, 2017 3:24 pm

Re: Samba and Windows usernames !

Postby acestu » Sun Aug 13, 2017 3:02 pm

Hi Altair,

I will rem them out 1 at a time and see what happens, this has occurred because I have been trying to learn from videos on youtube that are up to 9 years old and there does not seem to be any recent stuff so I am following or trying to follow tutorials that end up not working because the software that is being used has been unavailable for some time , also I took a backup of the smb.conf file off my non working computer network at my work premises to see if i could work out how it worked, as ever though thank you for sharing your knowledge it is greatly appreciated, I might try sharing to all tomorrow and see if that works.

cheers
Stuart

acestu
Level 1
Level 1
Posts: 27
Joined: Fri Aug 11, 2017 3:24 pm

Re: Samba and Windows usernames !

Postby acestu » Sun Aug 13, 2017 3:59 pm

Hi Altair,

Kept the Classic and remmed out the usershare, rebooted windows and working fine, thanks for your knowledge once again, I have also just looked for books on the subject on Amazon as I would love to learn more but there is just nothing recent available, if you know of anything that would be a bonus...

cheers
Stuart

p.s. does this forum allow you to give thanks, Karma, as I would like to show my thanks

altair4
Level 18
Level 18
Posts: 8745
Joined: Tue Feb 03, 2009 10:27 am

Re: Samba and Windows usernames ! (SOLVED)

Postby altair4 » Sun Aug 13, 2017 5:52 pm

I have also just looked for books on the subject on Amazon as I would love to learn more but there is just nothing recent available, if you know of anything that would be a bonus...

I don't know of any but even if there was something current it would be outdated by the time you received it. Such is the curse of open source. Write something for WinXP and it could be used for a decade. Write something for Linux and it's current for 6 months.
p.s. does this forum allow you to give thanks, Karma, as I would like to show my thanks

Nope. This is a rough neighbourhood. A responder is only as good as the next question and each questioner takes their chances that the responder knows what he's talking about.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.


Return to “Other networking topics”

Who is online

Users browsing this forum: No registered users and 1 guest