Guest User

[MAC] [BASH] - Fix Permissions for All Users

a guest
Feb 26th, 2013
287
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.06 KB | None | 0 0
  1. for i in /Users/*
  2. do
  3.  u=`echo $i | cut -d/ -f3`
  4.  case $u in
  5.   Shared)
  6.    ;;
  7.   Temporary)
  8.    ;;
  9.   *)
  10.    /usr/sbin/chown -R $u:staff $i
  11.    /bin/chmod -R 700 $i
  12.   ;;
  13.  esac
  14. done
  15. for i in /Users/*
  16. do
  17.  u=`echo $i | cut -d/ -f3`
  18.  case $u in
  19.   Shared)
  20.    ;;
  21.   Temporary)
  22.    ;;
  23.   *)
  24.    /usr/sbin/chown  $u:staff $i
  25.    /bin/chmod 755 $i
  26.   ;;
  27.  esac
  28. done
  29. /usr/sbin/chown -R 'root'::wheel '/Users/Shared'
  30. /bin/chmod -R 777 '/Users/Shared'
  31. for i in /Users/*
  32. do
  33.  u=`echo $i | cut -d/ -f3`
  34.  case $u in
  35.   Shared)
  36.    ;;
  37.   Temporary)
  38.    ;;
  39.   *)
  40.    /usr/sbin/chown -R $u:staff $i/Public
  41.    /bin/chmod -R 755 $i/Public
  42.   ;;
  43.  esac
  44. done
  45. for i in /Users/*
  46. do
  47.  u=`echo $i | cut -d/ -f3`
  48.  case $u in
  49.   Shared)
  50.    ;;
  51.   Temporary)
  52.    ;;
  53.   *)
  54.    /usr/sbin/chown -R $u:staff $i/Public/Drop\ Box
  55.    /bin/chmod -R 733 $i/Public/Drop\ Box
  56.   ;;
  57.  esac
  58. done
  59. for i in /Users/*
  60. do
  61.  u=`echo $i | cut -d/ -f3`
  62.  case $u in
  63.   Shared)
  64.    ;;
  65.   Temporary)
  66.    ;;
  67.   *)
  68.    /usr/sbin/chown -R $u:staff $i/Sites
  69.    /bin/chmod -R 755 $i/Sites
  70.   ;;
  71.  esac
  72. done
  73. exit 0
Advertisement
Add Comment
Please, Sign In to add comment