Forum

Duplicating a user account  

  RSS

0

To keep the work I do for different clients separate I create a user on my Mac for each client. To avoid needing to set up everything the way I like it every time I do this, I have a user named Template that I duplicate. Before upgrading to Mojave my procedure was to create a user in system preferences, then delete the user folder and use a terminal command to copy over the template user to a user folder with the name of the user I just created-

sudo cp -R /Volumes/Macintosh\ HD/Users/template /Volumes/Macintosh\ HD/Users/new_user_name

Then I'd fix the permissions with-

sudo chown -RP new_user_name:staff /Volumes/Macintosh\ HD/Users/new_user_name

Now after upgrading those commands give dozens of "Operation not permitted errors" like these-

cp: /Volumes/Macintosh HD/Users/new_user_name/Library/Mail: Operation not permitted

cp: /Volumes/Macintosh HD/Users/template/Library/Mail: unable to copy extended attributes to /Volumes/Macintosh HD/Users/new_user_name/Library/Mail: Operation not permitted

The new user account has no access to my contacts, even though it is connected to iCloud and things like Notes do synch. It also doesn't have my email setup. There may be other problems, but this are the ones that I saw immediately.

There used to be a way to do this with MigrationAssistant but when I tried that, instead of just copying my template from a backup and allowing for it to be renamed, it complained that template would be the only user on the machine and it was not an admin. That doesn't seem like something I'd want to continue with.

Anyone know how to do this with Mojave???

 
0

Thanks for the response but ditto won't copy some files either. I pasted the error messages below. The errors for MobileSync (iCloud if I remember right), AddressBook and Mail all seem to lead directly to problems I see. No Contacts available, Mail not working (it cannot even start. A notice appears that asks for an admin password because the library needs rebuilding and then mail crashes without ever opening a window).

ditto: /Users/template/./Library/Application Support/MobileSync: Operation not permitted

ditto: /Users/template/./Library/Application Support/CallHistoryTransactions: Operation not permitted

ditto: /Users/template/./Library/Application Support/com.apple.TCC: Operation not permitted

ditto: /Users/template/./Library/Application Support/AddressBook: Operation not permitted

ditto: /Users/template/./Library/Application Support/CallHistoryDB: Operation not permitted

ditto: /Users/template/./Library/IdentityServices: Operation not permitted

ditto: /Users/template/./Library/Calendars: Operation not permitted

ditto: /Users/template/./Library/Preferences/com.apple.mail-shared.plist: Operation not permitted

ditto: /Users/template/./Library/Preferences/com.apple.AddressBook.plist: Operation not permitted

ditto: /Users/template/./Library/Preferences/com.apple.homed.notbackedup.plist: Operation not permitted

ditto: /Users/template/./Library/Preferences/com.apple.homed.plist: Operation not permitted

ditto: /Users/template/./Library/Messages: Operation not permitted

ditto: /Users/template/./Library/HomeKit: Operation not permitted

ditto: /Users/template/./Library/Mail: Operation not permitted

ditto: /Users/template/./Library/Safari: Operation not permitted

ditto: /Users/template/./Library/Suggestions: Operation not permitted

ditto: /Users/template/./Library/Containers/com.apple.Safari: Operation not permitted

ditto: /Users/template/./Library/Containers/com.apple.iChat: Operation not permitted

ditto: /Users/template/./Library/Containers/com.apple.mail: Operation not permitted

ditto: /Users/template/./Library/PersonalizationPortrait: Operation not permitted

ditto: /Users/template/./Library/Metadata/CoreSpotlight: Operation not permitted

ditto: /Users/template/./Library/Metadata/com.apple.IntelligentSuggestions: Operation not permitted

ditto: /Users/template/./Library/Cookies: Operation not permitted

ditto: /Users/template/./Library/Caches/com.apple.safaridavclient: Operation not permitted

ditto: /Users/template/./Library/Caches/CloudKit/com.apple.Safari: Operation not permitted

ditto: /Users/template/./Library/Caches/com.apple.Safari: Operation not permitted

ditto: /Users/template/./Library/Caches/com.apple.Safari.SafeBrowsing: Operation not permitted

And this is when running with 'sudo' ?

 

NOTE: I have not actually tried to copy an account, so I'm mostly going on the 'man ditto' page, and historically knowing that ditto has been part of macOS for almost forever.

Yep, those errors are with 'sudo.' I made some progress. If I create a new account, then use 'ditto' to merge my template user folder with the new user folder (instead of deleting the new user folder as I did with my 'cp' solution) and then run the 'chown' command that I used to run after running 'cp' then I get mail to function but Contacts are still empty and none of my Safari settings, bookmarks, etc transfer. There might be more strangeness but that is what I have found so far.

Share: