What's new

Custom SMB config troubleshooting

  • 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!

Marko Polo

Senior Member
I've added some config option to smb.conf following the wiki, and it was added, but it was added in the end of smb.conf, i.e. to one of the shares. It commonly known, the structure of smb.conf is
[global options]
[share 1 options]
[share 2 options]
[share n options]

How to add my option to the global section? Should I specify section just in smb.conf.add? In the examples of .add file I met here, I found only pure lines, no section specification.

Thx.
 
You can only do it with a postconf script. Use the pc_insert command to match an exsiting string (like "[global]") and it will insert something on the following line:
Doesn't work for some reason. Maybe one should backslash the brackets?
 
Doesn't work for some reason. Maybe one should backslash the brackets?
Just tried it here and it works without any changes.

Code:
admin@RT-AC68U:/tmp/home/root# cat /etc/smb.conf
[global]
min protocol = NT1
workgroup = HOME
netbios name = RT-AC68U
server string = RT-AC68U
:
:
:

You have given the script the correct name? smb.postconf
 
Last edited:
Figured it out. Yes, the name was correct, however permissions were not 0777, like in other scripts. After I fixed this, all started to work.
But there is no single word in the wiki about permissions thing.
 
chmod a+rx sets them to 0755, which is sufficient rights to run them.
Strictly speaking a+rw adds 0555 to the permissions that already exist.:D

As the owner of the file almost certainly already has write access ;), this leads to at least 0755 but possibly higher.

As there is no assumption that the owner of the file is the same as the user account that will be executing it, rx permissions need to be set for all users.

Out of habit I tend to just use "chmod 755 myfile" which removes write permissions for non-owners if they have already been set.

Just being pedantic. :D:D:D
 
Last edited:
Strictly speaking a+rw adds 0555 to the permissions that already exist.:D

As the owner of the file almost certainly already has write access ;), this leads to at least 0755 but possibly higher.

As there is no assumption that the owner of the file is the same as the user account that will be executing it, rx permissions need to be set for all users.

Out of habit I tend to just use "chmod 755 myfile" which removes write permissions for non-owners if they have already been set.

Just being pedantic. :D:D:D
It's a good habit, AB-Solution uses 0755 or less where needed.
 

Sign Up For SNBForums Daily Digest

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