I decided to switch my Asus RT-AC68U’s firmware from DD-WRT to Asuswrt-Merlin. Unfortunately, Asuswrt-Merlin’s web GUI doesn’t allow the configuration of non-authenticated (i.e., guests or public) access to a Samba share.
Since I have some experience with Samba, I decided to write a quick bash script to modify the shares configuration.
I have a Samba share called public. Let’s look at the configuration file in
/tmp/etc/smb.conf and isolate the stanza we care about by using
In order to make the share allow non-authenticated full access, we need to do two things:
read list, and
Once that’s changed, we need to reload the configuration by restarting Samba.
Keeping in mind our goals above, I wrote up this script:
Now that we have our script, we need a way to trigger the script. Luckily, Asuswrt-Merlin supports postconf scripts. All we need to do is save the script in
/jffs/scripts/smb.postconf and we’re set.
After that’s done, we need to reboot our router so the script could do its thing.
First thing we should look at is the share’s configuration stanza. We could do that with the
sed command we used previously:
guest only and
writable options are set to
yes, you’re in business.
To test the functionality on the client side, we could do the following on Windows:
For Linux, the following will work:
If you have any issues or feedback, feel free to comment on the Github Gist.