Permissions dilema!

Discussion in 'macOS' started by steveyg777, Nov 18, 2009.

  1. steveyg777 macrumors newbie

    Joined:
    Nov 12, 2008
    #1
    I really need some expert advise so I don't muck up my system any more (I know how easy it is to do that when going anywhere near permissions from experience)

    my system messed up somehow when I loaded up my drive genius disk to do some maintenance (I clicked the rebuild button and it said it couldn't complete the task, after that it seemed like there was no hope for it! Wierd!)

    so, in the end I backed up my drive to a disk image, reformatted the drive, reinstalled mac osx snow leopard afresh, then used migration assistant to copy over the stuff from the disk image backup previously made. I also tried Manually copying as many files as possible over from the disk image (overwriting a lot of the freshly installed files including system files in the hope that that would Mean I had all of the settings, receipts, and specific files on my new mac osx install so it would be as close as possible to my old install. I didn't know if migration assistant would sort that out for me on it's own and know which reciepts it needed to copy so I wasnt gonna leave it to chance). I Dont know if this will cause problems???

    when I had done this I removed the original account that I had installed the system under so I was left with the two accounts only which had been migrated from my backup image. Are you still with me?

    Now the problem started, applications were complaining they could not access or save files, etc. I realised that permissions were messed up so had to edit the permissions of specific files in order to get the apps to work.

    Basically, when I get info on any file (not already edited, so most of the files on the system then!) I see that the permissions that exist for it are:

    _unknown - read and write
    admin - read only
    everyone - read only

    the "_unknown" user being the reference for the original user account that i deleted. Basically it doesn't know who is supposed to have permission for it (or is it's owner) any longer I think.

    So what I do is unlock the file and put my password in, add my current user to the list, change the permissions to read and write, click make me the owner and when I do that the _unknown user dissapears and then I click apply changes to enclosed items if it's a folder I'm editing.

    This works. When I click apply to enclosed items it doesn't take any notice and I still have to manually edit each file! If an application complains then I have to track the setting file, etc down and set it's permissions up properly.

    My question is can I do something to sort all of the permissions to how they should be without needing to edit every single file?

    What are the default permissions for a freshly installed system?

    If o one can suggest a solution then if I backup the current system via time machine, then go and install a new setup but restoring via time machine using the mac osx boot disk will it restore everything while sorting all the permissions out as they should be?
     
  2. wrldwzrd89 macrumors G5

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #2
    That is odd. I suppose you could use the Terminal to fix this problem, with the chown command and the -R switch (to make the operation recursive, i.e. affect every single file and folder within the one being changed).
     
  3. belvdr macrumors 603

    Joined:
    Aug 15, 2005
    #3
    I second this. Go to Terminal, and type:
    Code:
    id
    It will tell you what groups you are in. Note the first group name (believe it is usually staff).

    Then do:
    Code:
    cd /path/to/restored/files
    chown -R <your new username>:<group from above> *
    To ensure the perms are right, I would then do:
    Code:
    cd /path/to/restored/files
    
    The above statement is not needed if you haven't exited Terminal yet and are still in the directory.

    Code:
    find . -type f -exec chmod 644 {} \;
    find . -type d -exec chmod 755 {} \;
    
    This will set the perms on files and directories so that you have read/write, the group and everyone else will have read-only.
     
  4. steveyg777 thread starter macrumors newbie

    Joined:
    Nov 12, 2008
    #4
    ok, thank you so far for your help guys. i really appreciate it.

    however, i really do need the dummies guide to programming version of all advise, i haven't got the first clue when it comes to doing anything on the terminal to be honest.

    i did the id command and got:

    Last login: Fri Oct 30 22:33:13 on console

    MBP:~ Stevingo$ id
    uid=503(Stevingo) gid=20(staff) groups=20(staff),402(com.apple.sharepoint.group.1),204(_developer),100(_lpoperator),98(_lpadmin),80(admin),61(localaccounts),12(everyone),401(com.apple.access_screensharing)
    MBP:~ Stevingo$

    thats as far as ive got as of yet. gonna have a go and try to understand the rest of the commands now... to be continued :)
     
  5. steveyg777 thread starter macrumors newbie

    Joined:
    Nov 12, 2008
    #5
    ok, i tried to do the permissions command but either don't know which group i should choose (and is it 'staff' or 20 i need to type in?) or it won't let me because it is saying that it is "not permitted" after every file. i have tried typing:

    chown -R Stevingo:staff *
    chown -R Stevingo:20 *
    chown -R Stevingo:admin *
    chown -R Stevingo:80 *

    but none of them work!???

    should i use that sudo command? but if i do ive gotta be sure im definately addressing the right permissions...
     
  6. belvdr macrumors 603

    Joined:
    Aug 15, 2005
    #6
    Yes, use sudo when doing the chown. After you change it to your username, you don't need sudo any longer.

    Also, you can use either the group name or number; it doesn't matter. I use the name to ensure I'm typing the correct group.
     
  7. steveyg777 thread starter macrumors newbie

    Joined:
    Nov 12, 2008
    #7
    thanks, it seems to have worked guys! :)

    Just out of interest, what group should I be adding to? I added to staff, should I also be in admin? Or any others?

    What are the standard groups a user is in when mac osx is first installed?
     

Share This Page