The first step I would recommend is to try resetting your home folder permissions with the Reset Password utility in Lion Recovery. (Despite the name of the utility, you won't actually be resetting any passwords.)
Resetting the home folder permissions with the Reset Password utility will reset both the owner and the permissions.
Restart your Mac holding ⌘+R to boot into Lion Recovery, which will bring you to the Repair Utilities screen.
Open Terminal from the Utilities menu.
In Terminal, enter resetpassword
to open the Reset Password utility.
Choose your hard drive icon at the top, then choose your user from the drop-down menu below. Do not reset the password here.
At the bottom of the window, under "Reset Home Directory Permissions and ACLs", click the "Reset" button. This may take awhile if you have a lot of files in your home folder.
This should solve your permissions problems for most apps. However, it's possible you may have a few apps which had saved files with special permissions that are different from the user's default permissions (like preferences or application support files). For those apps, you may need to delete their preferences or reinstall the app.
If resetting your home folder permissions doesn't work, then you may need to try restoring from a backup or transferring your data to an external drive.
The files appearing read-only to you is probably only because you are currently not their owner.
What's likely happening is that the synced files retain the numeric owner-id from the source machine, and since that numeric uid in this particular case corresponds to the account macports on the target machine (in both transfer directions), macports has become the owner.
To verify that your account on each computer has the same numeric uid as the macports account has on the other machine, type the commands id -u
and id -u macports
in the Terminal in your account on both computers.
Fixing the cause of the problem
When information was submitted that the syncing is done using Synk Pro, I had a look at the Synk Pro web site and the app, and in the 'Advanced' settings I noticed the "Ownership:" option, which by default is set to "Copy If Possible".
Since it looks like Synk Pro transfers files' numeric uid, and there's no option for mapping this uid to another uid/account on the target computer, the way to make synced files be owned by you is to change the "Ownership:" setting to "Ignore".
Fixing the files
To fix the permission problem for the already synced files, you only need to change the owner of the files to your own account. Since (in this case) all of your synced folders are within your Home folder /Users/youraccount, you can do this with the following command in the Terminal when logged in to an administrator account (you'll have to give sudo the password of the admin account):
sudo chown -R youraccount /Users/youraccount
using the actual account name (also known as short user name) of your own account in place of youraccount. The account name is the same as the name of your account's Home folder in the /Users folder.
This will change all files and folders within the folder /Users/youraccount to be owned by youraccount (-R is for recursive), which should give you write-access to all of your files.
Since you earlier gave write-permission to 'everyone' for some files to be able to modify them, you may want to remove those permissions. This command:
sudo chmod -R u+w,go-w /Users/youraccount
ensures that the owner of your files, and no-one else, has write permission on them.
Type man chown
and man chmod
for more info about these commands.
Advice against using Finder to fix a folder's permissions
(I will update the below later)
Note: It is possible to change ownership and permissions of all files and folders in a folder tree using the Finder, by use of the controls at the very bottom of the Sharing & Permissions section of a Get Info window as shown in the picture in the question. One problem with this is that an account's home folder, and the standard subfolders therein, such as Library, Documents, Public and so forth, have special permissions (by use of ACLs) preventing them from being deleted among other things, and you don't want these special permissions to be removed or propagated to other folders and even files, so you should not use this unless you know very well what you are doing.
Best Answer
chmod
has an-R
option to apply changes recursively to a whole directory tree but I strongly recommend to not use it for your scenario as you can break quite a lot of things by applying it in places where you shouldn't.Instead