提交到新服务器上的 SVN 存储库的权限问题

发布于 2025-01-07 04:52:45 字数 933 浏览 0 评论 0 原文

我最近将我的 svn 存储库顺利地移动到具有相同路径结构的新服务器。我更改了 DNS,以便域名指向新服务器(并且互联网 DNS 管道知道这一点)。因此,我不必更新工作副本的存储库 URL(在 svn 信息中)。我可以很好地签出新副本,但提交更改会给我错误:

me$ svn ci -m "testing svn ci on new server"
Sending        trunk/www/index.php
Transmitting file data .svn: Commit failed (details follow):
svn: Can't open file '/var/svn/webrepo/db/txn-current-lock': Permission denied

好的,所以我尝试 sudo 相同的签入命令,但出现此错误:

svn: Commit failed (details follow):
svn: To better debug SSH connection problems, remove the -q option from 'ssh' in the [tunnels] section of your Subversion configuration file.
svn: Network connection closed unexpectedly

我在论坛中看到了类似的问题,解决方案为更新工作副本 URL 或修复远程权限。对于我来说,URL 应该没问题,但我一直在尝试修复权限。我可以与本地用户进行 ssh 正常连接。这是远程存储库权限:

drwxrwxr-x 6 svn svn 4096 Feb 20 07:33 webrepo

svn 组包含我通过 ssh 登录的远程用户帐户。我曾尝试直接对该用户以及 root 用户执行 chown'ing -R 操作,但没有成功。感谢您的帮助!

i recently moved my svn repositories to a new server with the same path structure without a hitch. i changed the DNS so that the domain name points to the new server (and the interweb DNS pipes are aware of this). therefore, i didn't have to update working copy's repo URL (in svn info). i can check out a new copy just fine, but committing a change gives me errors:

me$ svn ci -m "testing svn ci on new server"
Sending        trunk/www/index.php
Transmitting file data .svn: Commit failed (details follow):
svn: Can't open file '/var/svn/webrepo/db/txn-current-lock': Permission denied

ok, so i try to sudo the same check-in command, with this error:

svn: Commit failed (details follow):
svn: To better debug SSH connection problems, remove the -q option from 'ssh' in the [tunnels] section of your Subversion configuration file.
svn: Network connection closed unexpectedly

i've seen this similar problem in forums with a solution of either updating the working copy URL or fixing the remote permissions. the URL should be ok in my case, and I'm stuck trying to fix the permissions. i can ssh just fine with my local users. This is the remote repository permissions:

drwxrwxr-x 6 svn svn 4096 Feb 20 07:33 webrepo

the svn group contains my remote user account with which i ssh in. i have tried chown'ing -R to that user directly, as well as root and have had no luck. thanks for your help!

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

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

发布评论

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

评论(3

简单气质女生网名 2025-01-14 04:52:45

将 svn 移动到在 Linux 上运行的新服务器后,我遇到了同样的问题。 SVN 以 www-data 用户身份运行回购协议和所有文件和子目录必须属于 www-data。大多数情况都是这样,但有些文件由 root 拥有。通过运行

chown www-data 'new-repo' -R 

它解决了我的问题。

I've had the same problem after moving svn to a new server running on linux. SVN runs as www-data user & the repo & all files & sub directories has to be owned by www-data. Mostly this is the case but some files where owned by root. By running

chown www-data 'new-repo' -R 

it solved my problem.

你的呼吸 2025-01-14 04:52:45

同一存储库中的所有文件都具有此权限:drwxrwxr-x?用于测试目的的用户是否属于适当的组?我的意思是,有了上面的权限,只有所有者用户和所有者组才有权写入文件,如果您尝试提交某些内容,则可能会导致麻烦。

您是否尝试过比较

  • 的“用户”文件?
  • 存储库目录(递归地)

两台机器上的

All the files in the same repo has this rights: drwxrwxr-x? And the user used for testing purpose is in the appropriate group? I mean with this rights above, only the owner user, and the owner group have the right to write files, and it can cause trouble, if you try to commit something.

Have you tried to compare

  • the "users" file
  • the repo directory (recursively)

on the two machines?

_畞蕅 2025-01-14 04:52:45

您忘记以明文形式提及

  • 您使用哪个协议来访问存储库(从上下文发现 svn+ssh://,是的)
  • 您在哪个用户下 ssh 到存储库主机
  • 它是共享还是单用户存储库

阅读 Tunneling over SSH SVN 书中的主题,以便深入了解权限问题,主要围绕本文

在此示例中,Subversion 客户端正在调用本地 ssh
进程,连接到 host.example.com,以用户身份进行身份验证
harryssh (根据 SSH 用户配置),然后生成一个
以用户身份运行的远程计算机上的私有 svnserve 进程
哈利什。

和“SSH 配置技巧”

简而言之 - 你有错误的所有者,也许还有错误的权限

You forgot to mention in clear text

  • which protocol you use to access repo (from context discovered svn+ssh://, yes)
  • under which user you ssh to repo-host
  • Is it shared or single-user repo

Read Tunneling over SSH topic in the SVN book in order to understand permissions issues in deep, mostly around this text

In this example, the Subversion client is invoking a local ssh
process, connecting to host.example.com, authenticating as the user
harryssh (according to SSH user configuration), then spawning a
private svnserve process on the remote machine running as the user
harryssh.

and "SSH Configuration Tricks"

In short - you have wrong owner, and maybe, bad permissions

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