The following is a workaround to Apple's default chmod go-rwX on SMB /Users/Shared.
It is a copy and paste of my script in my server.
Warnings:
- Do NOT use this if you are not a system administrator.
- Uninstall as soon as you can change Apple's SMB default permissions.
Usage instructions are included in the script.
This works for me.
Yours,
----
#/bin/sh
# This is /Users/Shared/.RepairPermissionsInUsersShared.sh
# URL: https://discussions.apple.com/thread/3208098?start=105&tstart=0
#
# It repairs permissions of files under /Users/Shared (Apple OSX 10.9).
#
# To do:
# Uninstall as soon as you can change Apple's SMB default permissions from go-rwX to ugo+rwX under /Users/Shared/.
#
# How to install:
#
# 1. Move this script to /Users/Shared/.RepairPermissionsInUsersShared.sh
#
# 2. from the terminal:
#
# > chmod u+rwx /Users/Shared/.RepairPermissionsInUsersShared.sh
# > sudo crontab -e
#
# You are presented with the VIM editor.
# Press "i" to enter editing mode.
# Press "Command-v" to paste the following.
# Press "esc" to exit editing mode.
# Press ":w" to save.
# Press ":q" to quit.
#
# The following is the cron script to be copied and pasted above;
# remove the comments "#" (copy and paste in TextEditor.app, remove the comments, then copy and paste into VIM above).
#
# SHELL=/bin/sh
# PATH=/bin:/sbin:/usr/bin:/usr/sbin
# HOME=/var/log
# */1 09-17 * * 1-6 /Users/Shared/.RepairPermissionsInUsersShared.sh >> "/var/log/RepairPermissionsInUsersShared.log" 2>&1
#
# How to uninstall:
#
# terminal> sudo crontab -r
#
# log
#
# $1 [info,warning,error]
# $2 description
#
isotime="/bin/date +%Y-%m-%dT%H-%M-%S%z"
#logfile="/var/log/RepairPermissionsInUsersShared.log"
log() {
# echo "$( ${isotime} ) ${0}: ${1}: ${2}" >> "${logfile}" 2>&1
echo "$( ${isotime} ) ${0}: ${1}: ${2}"
}
#log info "This is $0"
# timestamp
#
TS="/Users/Shared/.timestamp"
if [ ! -f $TS ]; then
log info "Reparing permissions in /Users/Shared/..."
chflags -R nouchg /Users/Shared/*
find /Users/Shared -name ".DS_Store" -print0 | xargs -0 rm
find /Users/Shared -iname "desktop.ini" -print0 | xargs -0 rm
find /Users/Shared -name "Picasa.ini" -print0 | xargs -0 rm
find /Users/Shared -name "Thumbs.db" -print0 | xargs -0 rm
find /Users/Shared -name "ZbThumbnail.info" -print0 | xargs -0 rm
chmod -RN /Users/Shared
find /Users/Shared -type d -print0 | xargs -0 chmod 777
find /Users/Shared -type f -print0 | xargs -0 chmod 666
find /Users/Shared -name "*.exe " -print0 | xargs -0 chmod ugo+x
chgrp -R staff /Users/Shared/*
log info "Permissions repared."
log info "Creating timestamp..."
touch $TS
chmod 644 $TS
log info "Timestamp created."
exit 0;
fi
# update
#
#log info "Reparing permissions in /Users/Shared/...";
find /Users/Shared -type d -newer $TS -print0 | xargs -0 chmod -vv 777
find /Users/Shared -type f -newer $TS -print0 | xargs -0 chmod -vv 666
find /Users/Shared -type f -newer $TS -print0 | xargs -0 chown salbra:staff
find /Users/Shared -name "*.exe " -newer $TS -print0 | xargs -0 chmod -vv ugo+x
find /Users/Shared -newer $TS -print0 | xargs -0 chgrp staff
touch $TS;
chmod 744 $0
# end of script