由于命令“cp -R /Users/me/cs_project /Users/cs/”中的加密而导致错误

发布于 2024-07-29 01:35:51 字数 494 浏览 0 评论 0原文

问题:将目录树从“me”主用户复制到“cs”用户的加密硬盘驱动器:

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
...

问题:我如何复制我的项目主用户“me”到我的其他用户“cs”?

有关加密的新信息

我得到了与其他用户合作的建议,但没有与原始用户合作。 问题在于“cs”用户拥有 Mac 的 SafeVault 加密。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

人生戏 2024-08-05 01:35:51

“我”用户是管理员吗? 如果是这样,您可以以我的身份登录,然后使用以下命令手动挂载 cs 的主映像:

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

注意:sudo 命令将询问我的密码,然后 hdiutil 可能会弹出一个 GUI 对话框,询问 FileVault 主密码; 您可以提供此信息(如果您知道的话),或者点击取消按钮并在 CLI 提示时输入加密密码(即 cs 的密码)。 另外,映像应该在忽略文件所有权的情况下挂载,这意味着您不必使用 sudo cp 命令(OTOH,权限可能会有点奇怪复制的文件,因此请稍后清理它们)。

或者,您可以采取简单的方法:以我的身份登录,将文件复制/移动到某个公共位置,设置它们的权限以授予 cs 读取访问权限,然后以我的身份登录并复制它们。

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.

童话里做英雄 2024-08-05 01:35:51

您需要设置权限。 最简单的事情可能是:

$ su me
$ chmod -R o+r /Users/cs/cs_project

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

$ su me
$ chmod -R o+r /Users/cs/cs_project
最佳男配角 2024-08-05 01:35:51

无论您在哪个用户下运行此命令,都需要具有读取(和搜索目录,即 x 权限位)整个以 /Users/me/cs_project 为根的树的权限,并且获取在 /Users/cs 中写入的课程权限。 您可以根据需要使用命令 chmod 更改权限。

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.

初吻给了烟 2024-08-05 01:35:51

尝试 sudo cp -R /Users/me/cs_project /Users/cs/

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文