Enabling Anonymous Users to Write to SMB Network Shared Files in OpenWRT

Introduction

There are many methods available online, most of which involve editing the template by commenting out the line before invalid users = root. This allows the root user to manage the SMB user group. However, since the official default does not allow the use of root, there must be other ways. Today, I will introduce an alternative method to enable anonymous users to read and write to shared folder directories.

Procedure

Again, edit the template and scroll to the bottom to add the following lines:

create mask = 0666
directory mask = 0777
force group = root
force user = root

Remove the # in front of these lines to activate them.

Enabling Anonymous Users to Write to SMB Network Shared Files in OpenWRT

Save the changes and restart the SMB service with the command:<span>/etc/init.d/samba4 restart</span>

Conclusion

Using the force user directive allows anonymous users to access the shared folder as a specific user, enabling read and write capabilities. I am using this at home; if you are in a company or need to consider security, it is better to use a specific user with a password for enhanced security.

Leave a Comment