访问 HG 存储库时网络/Samba 共享权限被拒绝
我在 Ubuntu 10.10 中使用 EclipsePHP,并尝试使用 Mercurial (HG) 来处理位于我的网络连接临时服务器(samba 共享)上的存储库。
当尝试从 Eclipse 中刷新存储库时(实际上是 hg status),我收到以下错误: abort: Operation not allowed: /media/sharename/myrepository/.hg /.dirstate*
。
在试图找出问题所在时,我从终端进入网络共享并写入 hg status
- 发生了同样的错误,所以它不仅发生在 Eclipse 内部。我测试了我的计算机和服务器上的文件的 CHMOD - chmod 777 /media/sharename/myrepository/ -R - 没有任何变化。
但是当我不小心从 repo 目录中运行 sudo hg status 时,Mercurial 就开始了,并且工作得非常顺利。
我的电脑到底出了什么问题?为什么我无法在没有 root 身份的情况下运行我的 hg
命令?
I am using EclipsePHP in Ubuntu 10.10 and try to use Mercurial (HG) to work with a repository that's located on my network-connected staging server (samba share).
When trying to refresh the repository from within Eclipse (hg status
really) , I get the following error thrown in my face: abort: Operation not permitted: /media/sharename/myrepository/.hg/.dirstate*
.
Whilst trying to find out what's wrong, I went to the network share from terminal and wrote hg status
- the same error occurs, so it's not only occuring from within Eclipse. I tested to CHMOD the files from both my computer as well as the server - chmod 777 /media/sharename/myrepository/ -R
- nothing changes.
But when I accidentally ran sudo hg status
from the repo directory, Mercurial started the fireworks and worked like a charm.
What on earth is going wrong with my computer? Why can't i run my hg
commands without being root?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以像这样安装网络驱动器。打开 /etc/fstab/,然后输入以下行。
希望它能工作。
You can mount your network drive like this. Open your /etc/fstab/, and then enter the following line.
Hope it works.
我猜 chmod 不会帮助你。服务器端的所有权和权限不会复制到客户端(服务器上没有 unix 扩展),或者两台计算机之间的 UID/GID 不同。您可以通过以下方式挂载时覆盖文件所有权:
不过,这是从内存中获得的,请检查 man mount.cifs 了解详细信息。此外,在这种情况下,替代网络文件系统(如 NFS)可能会为您提供更好的服务,或者尝试 sshfs。
chmod will not help you here I guess. The ownership and permissions on the server side are not replicated to the client (no unix extensions on server) or your UID/GID differ between both machines. You can override file ownership when mounting via:
This is from memory though, check man mount.cifs for details. Also, alternative networked filesystems like NFS might serve you better in this case, or try sshfs.