A
A
Alexander Semenenko2019-02-26 11:31:13
linux
Alexander Semenenko, 2019-02-26 11:31:13

Access from windows to samba with a password. Why doesn't windows ask for a password?

Good afternoon.
I create a ball like this:

[usershare]
coment = User share
path = /shares/usershare
valid user = shareuser
guest ok = no
create mask = 0660
directory mask = 0771
available = yes
browseable = yes
public = yes
writeable = yes

I added security = user to the global.
With windows7 and windows 10, I can’t connect to this ball, it doesn’t even try to ask for a password.
The rights of the shares are:
drwx------ 4 shareuser root 4096 Feb 25 17:27 /shares/usershare/
If you manually enter the password into control userpasswords2, then it connects and everything works, but if you just try to enter the directory, then this:
5c74f911572ba508071193.jpeg
I will add:
if you give the rights 777 to this directory, then it gives you access, windows comes in as a guest and creates files with such rights -rw-rw---- 1 nobody:nogroup. So valid user = shareuser didn't work?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander Semenenko, 2019-02-27
@semenenko88

Here is my config that worked:

spoiler
[global]
workgroup = WORKGROUP
log file = /var/log/samba/log.%m
max log size = 1000
server role = standalone server
security = user
map to guest = Bad User
[share]
comment = Можно заходить всем
path =/shares/upload
create mask = 0777
directory mask = 0777
available = yes
browseable = yes
public = yes
writeable = yes
[private]
comment = Нужно ввести пароль
path = /shares/usershare
valid users = shareuser
create mask = 0660
directory mask = 0771
available = yes
browseable = yes
writeable = yes

The main thing is to use map to guest = Bad User together with security = user if we have one of the shares with guest access. Well, I removed something from the config, which prevented Windows from asking for a password, what exactly I didn’t understand, but I’ll leave the working config here.

A
Alexander Chernykh, 2019-02-26
@sashkets

well, as an option, you can map the folder as a network drive when the user logs in

B
Berkutman, 2019-02-26
@Berkutman

It is necessary to specify in the shared folder in security who is allowed access.
Next, go to Control Panel\Network and Internet\Network and Sharing Center\Advanced sharing settings
Well, everywhere also turn on network discovery. All.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question