How to safely edit samba config files?

hello

i searched the forum, trying to understand how to edit samba

on my beryl7, in the /etc/samba folder, i found all these files.

smb.conf
smb.conf.template
smb.conf.template3
smb.conf.template4
smb.conf.template4_old

–- not sure what each file is about? for different firmware versions or what?
— which file i should be editing?


after modifying the file, i read the need to reboot the router.
based on openwrt docs, should be able to service samba4 restart

thanks, david

The main file to edit should be smb.conf if any of those template files are used they also get included in the smb.conf if not they are modified copies of smb.conf and more serve as a example config you can choose to replace.

I would recommend to keep the current config, often the problem with these copy configs is that they may are not placed by the gl package but by samba itself, so this means these configuration may not work with gl firmware.

I did not use this feature with GL-iNet software so I don't know.

i did some testing, and i think that is incorrect advice.
after each reboot, whatever changes are made are LOST
if i edit smb.conf.template4, then reboot, the router updates smb.conf


again, i think is incorrect advise, in the forum, there are many examples of changing the samba config.
sure, a router firmware update or luci, could/will overwrite the changes, but that is to be expected.

———-
i did more research i found several topics from gl-inet staff editing the samba config file.

you need to edit /etc/samba/smb.conf.template

sed -i 's/smb encrypt = required/smb encrypt = auto/g' /etc/samba/smb.conf.template4
reboot

please, i just want confirmation, should i edit smb.conf.template4 or what?
thanks much, david

Hi,

Sorry for the late reply.

In the current firmware versions (v4.8 or v4.9), you need to edit smb.conf.template4 to make the changes persistent.

There is no need to worry too much about breaking anything, as you can find the default firmware backup in the /rom partition if needed.

1 Like

thanks much for the reply.

after i wrote that post, i did some testing and rebooting and figured out which file to edit.

1 Like

good to know

1 Like