Skip navigation
This discussion is archived

Change multiple user folder permissions

2630 Views 1 Reply Latest reply: Nov 30, 2009 11:31 AM by Andbrowny RSS
Anthony Stott Calculating status...
Currently Being Moderated
Nov 30, 2009 1:47 AM
Hi,

I'm hoping someone can help me. Stupidly I moved the folder where the users directories are with the finder. the result is I am having problems when a user logs is due to incorrect permissions. does anyone have a script or terminal command I can use to correct this issue. basically I need the folder name to be the owner and no access by other users. Thanks!
Mac OS X (10.5.8)
  • Andbrowny Level 4 Level 4 (1,610 points)
    Currently Being Moderated
    Nov 30, 2009 11:31 AM (in response to Anthony Stott)
    Hi Anthony, you could use something crude like

    #!/bin/bash
    Users=/Users.txt
    data=/pathto_Homedirectories
    #for a list of users from data folder
    ls -1 $data > $Users
    for name in $(awk '{print $1}' < "
    sudo chown -R $name $data/$name
    done

    exit

    This is assuming the Home Directory names are standard.
    You will need to edit the value for data.
    As always test, test, test and have a good known working backup.
    iMac ; MacBook ; MacBook Pro ; Mac Pro ; XServe ;, Mac OS X (10.5.6), OSX Server ; .local AD ; WINXP/Vista via Parallels Mac OS X 10.5.x/10.4.x

Actions

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.