为什么我的 Apache 文件权限被重置?
我们最近在工作中从使用 PC 转向使用 Mac,因此我对 *nix 的做事方式还很陌生。 我运行的是 10.5 附带的默认 Apache,但我注意到,当我将文件从 Windows 服务器拖到我的计算机时,权限会发生更改。 具体来说,我正在将数据写入 XML 文件,有时在来回交换一些文件后,它会停止工作。
有人可以帮助我理解为什么会发生这种情况,以及如何强制 Windows 尊重原始文件权限(它们是在我创建文件时在我的计算机上设置的),或者在文件从以下位置移动时应用一组不太安全的默认权限: Windows 到 Mac?
需要注意的几个事实:
- 我正在使用 Cornerstone Subversion 客户端。
- 如果你帮我拼写出来,我可以使用终端。
- 最终,我通过 传输 将这些文件上传到另一个位置的 Linux 服务器。
- 我已经熟悉使用“获取信息”来更改文件权限,但也许我做错了什么。
- 我以 root 身份登录。 (我知道,糟糕糟糕糟糕。)
我还应该提到,我知道这是一个简单的问题,应该有一个简单的答案,但我已经用谷歌搜索了没有找到它。 我需要你的帮助。
谢谢。
We recently switched from using PCs at work to Macs, so I'm new to the *nix way of doing things. I have the default Apache running that shipped with 10.5, but I've noticed that when I drag files from a Windows server to my machine, the permissions are changed. Specifically, I'm writing data to an XML file, and occasionally after swapping some files back and forth, it stops working.
Can someone help me understand why this is happening and how I can either force Windows to respect the original file permissions (they were set on my machine when I created the file) or apply a less secure set of default permissions when the files are moved from Windows to Mac?
A couple facts to be aware of:
- I'm using the Cornerstone Subversion client.
- I can use Terminal if you spell it out for me.
- Ultimately I'm uploading these files via Transmit to a Linux server in another location.
- I'm already familiar with using Get Info to change the file permissions, but maybe I'm doing something wrong.
- I'm logged in as root. (I know, bad bad bad.)
I should also mention I know this is a simple question that should have a simple answer, but I've googled up and down without finding it. I need your help.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您可以转到终端,使用 cd 导航到包含因权限而无法工作的文件的文件夹,然后键入: ls -l (后面都是小写的 L),这将非常有帮助。
如果您从主文件夹开始,它将看起来像这样:
请将输出粘贴到此线程中。 了解 Apache 正在更改权限的内容会有所帮助。
顺便说一句,Apache 通常在与登录用户不同的用户和权限级别下运行,因此如果它以某种方式创建或覆盖文件,它可能会以这种方式更改权限。
It would be incredibly helpful if you could drop to the Terminal, use cd to navigate to the folder with the files that don't work because of permissions and then type: ls -l (those are both lowercase Ls back there).
If you start from your home folder, it'll look something like this:
Please paste the output into this thread. Knowing what Apache is changing the permissions to would help.
On a side note, Apache generally runs under a different user and permission level than the logged in user and so if it's somehow creating or overwriting files it may be changing the permissions that way.