What's new

Samba share windows folder permissions

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

vprasinos

Occasional Visitor
I'm still using 270.26 merlin's firmware (due to wireless drivers). I recently connected an ext3 4TB Samsung drive (Seagate enclosed) and transfered my entware system, everything went smoothly.

What was different though is that previously I was using a WD NTFS drive and creating folders though samba in windows was producing folders with 777 rights and root ownership. This is not now the case with ext3. Creating folders produces the 777 rights correctly in folders (force directory mode = 0777, force create mode = 0777 do exist in my smb.conf) BUT the owner/group of the folders is "nobody".

If I use winscp to create folders, they are created normally with user "admin" and group "root". How can I configure smb.conf to use the admin account or is there any other way to automatically create folders through samba with user admin?

PS. "Share with account" is disabled in router's samba web ui. I have an RT-N66U.
 
Last edited:
No replies...

Let me post the default and generic /etc/smb.conf used by the router when "Share with account" is disabled.

[global]
workgroup = WORKGROUP
netbios name = Asus
server string = Asus
unix charset = UTF8
display charset = UTF8
log file = /var/log.samba
log level = 0
max log size = 5
security = SHARE
guest only = yes
encrypt passwords = yes
pam password change = no
null passwords = yes
force directory mode = 0777
force create mode = 0777
max connections = 5
socket options = TCP_NODELAY SO_KEEPALIVE SO_RCVBUF=32768 SO_SNDBUF=32768
obey pam restrictions = no
use spne go = no
client use spnego = no
disable spoolss = yes
host msdfs = no
strict allocate = No
bind interfaces only = yes
interfaces = lo br0
use sendfile = no
map archive = no
map hidden = no
map read only = no
map system = no
store dos attributes = yes
dos filemode = yes
dos filetimes = yes
dos filetime resolution = yes
[Movies]
comment = WD My Book 1140's Movies
path = /tmp/mnt/Movies
writeable = yes
[Samsung]
comment = Samsung D3 Station's Samsung
path = /tmp/mnt/Samsung
writeable = yes

[global]
force user = admin


I've added the last 2 lines myself using /jffs/smb.conf.add. However the folder ownership is still user:nobody group:nobody when creating new folders through the smb share. What else can I try?
 
First....the smb.conf.add needs to be in /jffs/configs not /jffs (I'm assuming you just made a typo).

Second, I'm not sure you can have 2 sections with the same name [global]. I'd try the following as /jffs/scripts/smb.postconf (make sure you set it to executable)

Code:
#!/bin/sh
CONFIG=$1
source /usr/sbin/helper.sh
pc_insert "workgroup = WORKGROUP"  "force user = admin" $CONFIG

which will insert the 'force user' into the main [global] section
 
Yes it was a typo. However I don't think postconf is supported in 270.26. I quote the wiki:
"Since some of these entries require dynamic parameters, you might be better using the postconf scripts added in 374.36".

My 270.26 is, I think, earlier than 374.36. So I guess I'm stuck at this...

2 questions though:
1. Is there a problem having folders created with "nobody" instead of "admin" when copying or moving files around using the samba share?
2. What if I add the command to the share section, for example [Movies] of smb.conf? Does it work having 2 sections of [Movies]?
 
Sorry I missed the level....you are correct about postconf not being available.

What about just using a full override smb.conf by copying and then editing the /etc/smb.conf into /jffs/configs. At least it might tell you if you are on the right track.
 
Seems that they stick in /etc/smb.conf. I will try to reboot when I get home and see if it's still there. Will report back.

It does stick after reboot! Thanks for the help!
 
Last edited:

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top