I am facing an issue with Samba shares setup for windows use. I have two shares - 1] public share, which is available for everyone in the network, 2] admin share, which is supposed to be password protected for just two users.

The public share is working fine without any problems. The private one is created, is visible from windows under the Raspberry device, but I can't access it using Samba user. I have spent a lot of time searching, but can find what I am doing wrong.

Here is definition of folders in smb.conf:

comment = Shared folder
path = /media/external/share
public = yes
writable = yes
guest ok = yes
create mask = 0775

comment = Admin folder
path = /media/external/share
public = no
guest ok = no
valid users = pi admin

in Authentication part I use

security = user

I have both users created as linux users and also as Samba users.

When I open "Share" folder in Win 7, it is fine. When I open "Admin" folder, windows logon form appears - as I wanted. But when I use user "admin" and put the password which I set in Samba, I get "Permission denied" error message. What am I doing wrong?


I think you may be hit by an annoying long standing issue that is solved in Windows 8: you can't login to the same server both anonymously and password protected, even if it's a different share. Some weeks ago, I was struggling with this too. On Windows 8, the public share was readily available, but on Windows 7, I could not get permission.

What I did is use the valid users directive for the private shares, like you did. Then I also said public = no to the public share, and just make sure everybody's user is present in the samba user database (pdbedit -L). This is a lot easier when this samba server is also a domain controller, BTW.

I then also set force user and force group so that files won't be owned by whoever makes it. However, there are other ways of doing this. You could also fiddle with ACL's and retain the original ownership info. However, the force group and user options are far easier :)

BTW, public and guest ok are synonymous.


Jan 2018 Windows 7. I also had the request to login from my Windows 7 PC to My Linux drive. My solution was simply so supply the Router login name admin and router password.

Hope that helps someone. Steve

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.