Hey Guys,
many users try to get rid of the Public shares folder or at least restrict access with more or less success. Some working solutions do not survive a reboot. That’s why I grepped my way through the MyCloud scripts and found a satisfactory way (for me) to do exactly that.
You will need root access for your MyCloud so please be aware you may break somethning! Do this at your own risk!
/etc/wdcomp.d/boot//bootscript_005_wd-nas
Comment out the following lines:
----
#uniqShareName=“$(createUniqueShare “Public” “Public” “any”)”
#result=$?
#if [$result -eq 0]; then
logger -s -p local2.debug "$0: DEBUG: createUniqueShare ${uniqShareName} returned$
#else
logger -s -p local2.err "$0: ERROR: createUniqueShare ${uniqShareName} returned $$
#fi
This will prevent your mycloud from (re)creating the Public folder.
/usr/local/sbin/createDataVolume.sh
comment out these lines
mkdir -p “/DataVolume/shares/Public/Shared Music”
mkdir -p “/DataVolume/shares/Public/Shared Videos”
mkdir -p “/DataVolume/shares/Public/Shared Pictures”
—
#chown -R root:share /DataVolume/shares/Public
Will prevent your mycloud to lay out the filesystem for the public share.
/usr/local/sbin/deleteShare.sh
comment out these lines
#lowerCaseShare=echo $shareName | tr '[:upper:]' '[:lower:]'
#if [$lowerCaseShare == “public”]; then
echo “Cannot delete Public share”
exit 1
#fi
Will make it possible to use WDs own script to delete the public share. I like this solution because it does everything that is needed to remove a share not just delete the folder structure or remove samba config etc…
execute this command:
----
/usr/local/sbin/deleteShare.sh Public
Will finally remove the Public share and associated infos on the device.
After following these steps the Public share folder should be permanently removed and not revive reboots.
Yours sincerely,
schnip