Ok, here is my smb.conf:


workgroup = workgroup
server string = %h
dns proxy = no

log file = /var/log/samba/log.%m
max log size = 1000
syslog = 0
panic action = /usr/share/samba/panic-action %d

usershare allow guests = yes
security = user
map to guest = Bad Password
guest ok = yes
guest account = myguest
username map = /etc/samba/smbusers

comment = Public Files
path = /media/store/Public
writeable = yes
guest ok = yes
create mask = 775
directory mask = 775

comment = My User Only
path = /media/store/myuser
guest ok = no
valid users = myuser
admin users = myuser
writeable = yes
create mask = 775
directory mask = 775

The issue I have is that the myuser share saves everything as root. If I remove the admin users line, it then saves them as my guest user. Never as myuser.
How can I set this up so that is just saves files and makes myuser the owner?

2 Answers 2


map to guest = Bad Password is causing any incorrect password to be accepted and mapped to the guest user -- even 'tho guest ok is no. Try setting it to Bad User instead. That way you are forced to provide the correct password for myuser. And remove admin user as that will force you to be root.

  • Ok, I changed that and it still comes out to myguest as the owner of the files created.
    – user277244
    Commented Jan 28, 2014 at 23:14
  • See, what's crazy is that I need to enter in my user and password to gain access. It accepts my user and password, but files created are using the guest account. How does that happen?
    – user277244
    Commented Jan 28, 2014 at 23:23
  • If I completely comment out the guest stuff at the top, the files are owned by nobody in the group nogroup
    – user277244
    Commented Jan 28, 2014 at 23:28

Have you tried running:

chgrp myuser /media/store/myuser && chmod g+s /media/store/myuser

This will make it so any item in the folder or anything put in there in the future is given the owner of myuser.

Is this what you're trying to do?

  • chown will change the current files, but do nothing for new files.
    – Ricky
    Commented Jan 28, 2014 at 23:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .