[SOLVED] Samba win7 keeps asking for credential

Questions about Wi-Fi and other network devices, file sharing, firewalls, connection sharing etc
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
Beerforfree

[SOLVED] Samba win7 keeps asking for credential

Post by Beerforfree »

It use to work in the past, after upgrading to Mint 19.1 and having made any changes to win7 I'm not able to see shared folder on win7 from my mint box

On win7
Passwd protected sharing is turned off
allow win to manage homegroup is turned on
all sharing options are turned on

there is no psswd to log into win
user = werner

On Mint
smb.conf
[global]
workgroup = WORKGROUP
#added by Werner 26/12/18
force user = werner
server string = %h server
wins support = no
; wins server = w.x.y.z
dns proxy = no
[authentication]
server role = standalone server
passdb backend = tdbsam
obey pam restrictions = yes
map to guest = bad user

etc

Login user = werner
same as samba user

Using nemo I can't see anything under Network -- windows network
Typing smb://acer/public on nemo asks me for credentials
ping to win box's IP works well
win box can access mint box
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
altair4
Level 20
Level 20
Posts: 11461
Joined: Tue Feb 03, 2009 10:27 am

Re: Samba win7 keeps asking for credential

Post by altair4 »

Modern samba requires you to pass credentials to a Windows box. Selecting Anonymous doesn't seem to work so people have come up with all kids of gimmicks to side step the issue:

Passing user = guest with a password of xxx
Passing your mint user name with your login password.
Passing your mint user name with the samba password for that user.

Note: The "samba password" is the one you create when you add yourself to the samba password database:

Code: Select all

sudo smbpasswd -a your-mint-user-name
Using nemo I can't see anything under Network -- windows network
Another change samba made to accommodate Win10 breaks network browsing. To set the samba client back to how it worked in the past:

Edit /etc/samba/smb.conf and add the following line under the workgroup = WORKGROUP line:

Code: Select all

client max protocol = NT1
Then reboot the box.
win box can access mint box
I will take your word for that but your smb.conf is a bit of a mess.

There is no such service as [authentication] so samba will treat it as a share definition and since there is no path it will just disable all those setting. You can verify this yourself by running this command:

Code: Select all

testparm -s
You should see these error messages:
Processing section "[authentication]"
Global parameter server role found in service section!
Global parameter passdb backend found in service section!
Global parameter obey pam restrictions found in service section!
Global parameter map to guest found in service section!
WARNING: No path in service authentication - making it unavailable!
NOTE: Service authentication is flagged unavailable.
There is a backup copy of the original smb.conf at /usr/share/samba is you want to reset yourself and copy it over to /etc/samba.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
Beerforfree

Re: Samba win7 keeps asking for credential

Post by Beerforfree »

The authetincation part was there I don't remember changing something on it, even less with my poor knowledge on this
Here is the output of tesparm
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$]"
Loaded services file OK.
Server role: ROLE_STANDALONE

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


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


[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
altair4
Level 20
Level 20
Posts: 11461
Joined: Tue Feb 03, 2009 10:27 am

Re: Samba win7 keeps asking for credential

Post by altair4 »

That looks better but that is not testparm run against this smb.conf:
Beerforfree wrote: Wed Jan 23, 2019 7:25 pm On Mint
smb.conf
[global]
workgroup = WORKGROUP
#added by Werner 26/12/18
force user = werner
server string = %h server
wins support = no
; wins server = w.x.y.z
dns proxy = no
[authentication]
server role = standalone server
passdb backend = tdbsam
obey pam restrictions = yes
map to guest = bad user
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
Beerforfree

Re: Samba win7 keeps asking for credential

Post by Beerforfree »

We made some progress, after adding the line under workgroup I'm able to see the winbox but is still asking for credentials
altair4
Level 20
Level 20
Posts: 11461
Joined: Tue Feb 03, 2009 10:27 am

Re: Samba win7 keeps asking for credential

Post by altair4 »

And it always will.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
Beerforfree

Re: Samba win7 keeps asking for credential

Post by Beerforfree »

Sorry I made a typo the authentication part was between **** and not []
After comparing both smb.conf there are no differences just in a couple of lines force user and the one you passed me
Beerforfree

Re: Samba win7 keeps asking for credential

Post by Beerforfree »

Perhaps the right thing to do would be downgrade samba, which version should I use, any hints to do that are welcome
altair4
Level 20
Level 20
Posts: 11461
Joined: Tue Feb 03, 2009 10:27 am

Re: Samba win7 keeps asking for credential

Post by altair4 »

Does that mean this didn't work:
altair4 wrote: Thu Jan 24, 2019 10:49 am Modern samba requires you to pass credentials to a Windows box. Selecting Anonymous doesn't seem to work so people have come up with all kids of gimmicks to side step the issue:

Passing user = guest with a password of xxx
Passing your mint user name with your login password.
Passing your mint user name with the samba password for that user.

Note: The "samba password" is the one you create when you add yourself to the samba password database:

Code: Select all

sudo smbpasswd -a your-mint-user-name
You can always create a user in Win7 - call it smbuser, give it a password, make sure whatever folder you are sharing allows access by smbuser, then use that username to access the Win7 share from Linux.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
Beerforfree

Re: [SOLVED] Samba win7 keeps asking for credential

Post by Beerforfree »

SOLUTION Sharing folders between Mint 19.1 and W7
On Mint
add under [global]
force user = your user --> this will allow Win7 to access DVD drive
client max protocol = NT1 --> this enables Mint to see Win7 shared folders

On Win7
Password protected sharing = ON
Create user with password and use it as credential to access folders

I remember that several years ago to be able to share the DVD permanently on my Linux box, but I don't recall how to do that
By now I have to share it after a media is inside it and mounted
Locked

Return to “Networking”