Instantly share code, notes, and snippets.

What would you like to do?
Modify smb.conf to allow guest access to "public" share, using with asuswrt-merlin
# Grant guess access
sed -i '/\[public\]/,/^\[/ s/invalid users.*/guest only = yes\nwritable = yes/' /etc/smb.conf
# Remove user-specific ACLs
sed -i '/\[public\]/,/\[/ {/^\(valid\|invalid\|read\|write\)/d}' /etc/smb.conf
# Kill samba processes running
for pid in $(ps -w | grep [s]mbd | awk '{ print $1 }')
kill $pid 2> /dev/null
# Restart samba with modified config
smbd -D -s /etc/smb.conf

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment