views:

73

answers:

4

Problem: to copy a directory tree from the "me" master user to the encrypted harddrive of the "cs"-user:

su cs 

bash-3.2$ cp -R /Users/me/cs_project /Users/cs/
cp: /Users/cs/cs_project: Permission denied
cp: /Users/me/cs_project/h_mark: unable to copy extended attributes to /Users/cs/: Permission denied
cp: /Users/cs/: No such file or directory
...

Question: How can I copy my project of the master user "me" to my other user "cs"?

New information about the Encryption

I got the suggestions working with other users, but not with the origal users. The problem is that the 'cs' user has Mac's SafeVault encryption.

A: 

Whatever user you're running this command under needs permission to read (and search dirs, i.e. the x permisison bit) throughout the tree rooted at /Users/me/cs_project and for course permission to write in /Users/cs. You can change permissions as needed with command chmod.

Alex Martelli
A: 

You need to set permissions. The easiest thing is probably:

$ su me
$ chmod -R o+r /Users/cs/cs_project
William Pursell
A: 

try sudo cp -R /Users/me/cs_project /Users/cs/

ennuikiller
+1  A: 

Is the "me" user an administrator? If so, you can log in as me, then manually mount cs's home image with:

sudo hdiutil mount /Users/cs/cs.sparsebundle
cp -R /Users/me/cs_project /Volumes/cs/

Notes: the sudo command will ask for me's password, and then hdiutil might pop up a GUI dialog asking for the FileVault master password; you can either supply this (if you know it), or hit the cancel button and enter the encryption password (i.e. cs's password) in the CLI when it prompts for that. Also, the image should mount with file ownership ignored, meaning that you don't have to sudo the cp command (OTOH, the permissions may come out a little weird on the copied files, so expect to clean them up afterward).

Alternately, you could take the easy way: log in as me, copy/move the files to some public location, set the permissions on them to grant cs read access, then log in as me and copy them.

Gordon Davisson