Git 无法通过SSH进行克隆

Git 无法通过SSH进行克隆,git,ssh,rhodecode,Git,Ssh,Rhodecode,我发现,但我的问题不是RC由错误的用户运行。我的SSH克隆URL如下所示:ssh://root@my.tld/另一个测试,访问被拒绝 然而,HTTP克隆工作得很好 我的公钥也在我的RC配置文件中。以下是cat/var/log/auth.log中的内容: Jul 21 01:52:05 CODE sshd[21525]: Accepted publickey for root from [REDACTED] port 50481 ssh2: RSA SHA256:qwerty Jul 21 01:

我发现,但我的问题不是RC由错误的用户运行。我的SSH克隆URL如下所示:
ssh://root@my.tld/另一个测试
,访问被拒绝

然而,HTTP克隆工作得很好

我的公钥也在我的RC配置文件中。以下是
cat/var/log/auth.log
中的内容:

Jul 21 01:52:05 CODE sshd[21525]: Accepted publickey for root from [REDACTED] port 50481 ssh2: RSA SHA256:qwerty
Jul 21 01:52:05 CODE sshd[21525]: pam_unix(sshd:session): session opened for user root by (uid=0)
Jul 21 01:52:05 CODE systemd-logind[847]: New session 1607 of user root.
Jul 21 01:52:06 CODE sshd[21525]: Received disconnect from [REDACTED] port 50481:11: disconnected by user
Jul 21 01:52:06 CODE sshd[21525]: Disconnected from user root [REDACTED] port 50481
Jul 21 01:52:06 CODE sshd[21525]: pam_unix(sshd:session): session closed for user root
Jul 21 01:52:06 CODE systemd-logind[847]: Removed session 1607.
KeyError: 'HEAD'
2019-07-21 02:02:22.883 [1099] INFO  [vcsserver.tweens] IP: 127.0.0.1 Request to path: `/git` time: 0.005s
2019-07-21 02:02:22.887 [<1099>  ] GNCRN 127.0.0.1       rqt:0.009307 200 51     "POST:/git " usr:- "-" "PycURL/7.43.0.2 libcurl/7.59.0 OpenSSL/1.0.2p zlib/1.2.11 libssh2/1.8.0 nghttp2/1.24.0"
2019-07-21 02:02:50.693 [1099] DEBUG [vcsserver.http_main] method called:assert_correct_path with kwargs:{} context_uid: [REDACTED]
2019-07-21 02:02:50.693 [1099] DEBUG [dogpile.lock] NeedRegenerationException
2019-07-21 02:02:50.693 [1099] DEBUG [dogpile.lock] no value, waiting for create lock
2019-07-21 02:02:50.694 [1099] DEBUG [dogpile.lock] value creation lock <dogpile.cache.region._LockWrapper object at 0x7f42aeecd590> acquired
2019-07-21 02:02:50.694 [1099] DEBUG [dogpile.lock] Calling creation function for not-yet-present value
2019-07-21 02:02:50.694 [1099] DEBUG [dogpile.lock] Released creation lock
2019-07-21 02:02:50.695 [1099] INFO  [vcsserver.tweens] IP: 127.0.0.1 Request to path: `/git` time: 0.002s
2019-07-21 02:02:50.695 [<1099>  ] GNCRN 127.0.0.1       rqt:0.002517 200 51     "POST:/git " usr:- "-" "PycURL/7.43.0.2 libcurl/7.59.0 OpenSSL/1.0.2p zlib/1.2.11 libssh2/1.8.0 nghttp2/1.24.0"
2019-07-21 02:02:50.869 [1099] DEBUG [vcsserver.http_main] http-app: handling git stream
2019-07-21 02:02:50.869 [1099] DEBUG [vcsserver.http_main] LFS: Detecting if request `/another-test/info/refs` is LFS server path based on content type:``, is_lfs:False
2019-07-21 02:02:50.869 [1099] DEBUG [vcsserver.http_main] LFS: fallback detection by path of: `/another-test/info/refs`, is_lfs:False
2019-07-21 02:02:50.869 [1099] DEBUG [vcsserver.http_main] http-app: starting app handler with <vcsserver.scm_app.GitHandler object at 0x7f42aeecd590> and process request
2019-07-21 02:02:50.878 [1099] INFO  [vcsserver.tweens] IP: 127.0.0.1 Request to path: `/another-test/info/refs` time: 0.010s
2019-07-21 02:02:50.879 [<1099>  ] GNCRN 127.0.0.1       rqt:0.010726 200 38     "GET:/another-test/info/refs service=git-upload-pack" usr:- "-" "git/2.20.1 (Apple Git-117)"
不太清楚我做错了什么

/root/.rccontrol/community-1/rhode.ini
中,我在SSH部分看到了这一点:

## AuthorizedKeysFile %h/.ssh/authorized_keys %h/.ssh/authorized_keys_rhodecode
ssh.authorized_keys_file_path = ~/.ssh/authorized_keys_rhodecode
我想也许我应该使用
ssh.authorized_keys_file_path
AuthorizedKeysFile
但是
rccontrolstatus
不喜欢这样

代码控制版本:1.23.0 无法分析/root/.rccontrol/community-1/rhode.ini 第589行的无效行('AuthorizedKeysFile%h/.ssh/authorized_-keys%h/.ssh/authorized_-keys_-code')(既不匹配节也不匹配关键字)。 cat/root/.rccontrol/vcsserver-1/vcsserver.log的输出

Jul 21 01:52:05 CODE sshd[21525]: Accepted publickey for root from [REDACTED] port 50481 ssh2: RSA SHA256:qwerty
Jul 21 01:52:05 CODE sshd[21525]: pam_unix(sshd:session): session opened for user root by (uid=0)
Jul 21 01:52:05 CODE systemd-logind[847]: New session 1607 of user root.
Jul 21 01:52:06 CODE sshd[21525]: Received disconnect from [REDACTED] port 50481:11: disconnected by user
Jul 21 01:52:06 CODE sshd[21525]: Disconnected from user root [REDACTED] port 50481
Jul 21 01:52:06 CODE sshd[21525]: pam_unix(sshd:session): session closed for user root
Jul 21 01:52:06 CODE systemd-logind[847]: Removed session 1607.
KeyError: 'HEAD'
2019-07-21 02:02:22.883 [1099] INFO  [vcsserver.tweens] IP: 127.0.0.1 Request to path: `/git` time: 0.005s
2019-07-21 02:02:22.887 [<1099>  ] GNCRN 127.0.0.1       rqt:0.009307 200 51     "POST:/git " usr:- "-" "PycURL/7.43.0.2 libcurl/7.59.0 OpenSSL/1.0.2p zlib/1.2.11 libssh2/1.8.0 nghttp2/1.24.0"
2019-07-21 02:02:50.693 [1099] DEBUG [vcsserver.http_main] method called:assert_correct_path with kwargs:{} context_uid: [REDACTED]
2019-07-21 02:02:50.693 [1099] DEBUG [dogpile.lock] NeedRegenerationException
2019-07-21 02:02:50.693 [1099] DEBUG [dogpile.lock] no value, waiting for create lock
2019-07-21 02:02:50.694 [1099] DEBUG [dogpile.lock] value creation lock <dogpile.cache.region._LockWrapper object at 0x7f42aeecd590> acquired
2019-07-21 02:02:50.694 [1099] DEBUG [dogpile.lock] Calling creation function for not-yet-present value
2019-07-21 02:02:50.694 [1099] DEBUG [dogpile.lock] Released creation lock
2019-07-21 02:02:50.695 [1099] INFO  [vcsserver.tweens] IP: 127.0.0.1 Request to path: `/git` time: 0.002s
2019-07-21 02:02:50.695 [<1099>  ] GNCRN 127.0.0.1       rqt:0.002517 200 51     "POST:/git " usr:- "-" "PycURL/7.43.0.2 libcurl/7.59.0 OpenSSL/1.0.2p zlib/1.2.11 libssh2/1.8.0 nghttp2/1.24.0"
2019-07-21 02:02:50.869 [1099] DEBUG [vcsserver.http_main] http-app: handling git stream
2019-07-21 02:02:50.869 [1099] DEBUG [vcsserver.http_main] LFS: Detecting if request `/another-test/info/refs` is LFS server path based on content type:``, is_lfs:False
2019-07-21 02:02:50.869 [1099] DEBUG [vcsserver.http_main] LFS: fallback detection by path of: `/another-test/info/refs`, is_lfs:False
2019-07-21 02:02:50.869 [1099] DEBUG [vcsserver.http_main] http-app: starting app handler with <vcsserver.scm_app.GitHandler object at 0x7f42aeecd590> and process request
2019-07-21 02:02:50.878 [1099] INFO  [vcsserver.tweens] IP: 127.0.0.1 Request to path: `/another-test/info/refs` time: 0.010s
2019-07-21 02:02:50.879 [<1099>  ] GNCRN 127.0.0.1       rqt:0.010726 200 38     "GET:/another-test/info/refs service=git-upload-pack" usr:- "-" "git/2.20.1 (Apple Git-117)"
KeyError:'HEAD'
2019-07-21 02:02:22.883[1099]信息[vcsserver.tweens]IP:127.0.0.1请求路径:`/git`时间:0.005s
2019-07-21 02:02:22.887[]GNCRN 127.0.0.1 rqt:0.009307 200 51“POST:/git”usr:-“-”PycURL/7.43.0.2 libcurl/7.59.0 OpenSSL/1.0.2p zlib/1.2.11 libssh2/1.8.0 nghttp2/1.24.0”
2019-07-21 02:02:50.693[1099]调试[vcsserver.http_main]方法调用:assert_correct_path with kwargs:{}context_uid:[已编辑]
2019-07-21 02:02:50.693[1099]调试[dogpile.lock]需要再生异常
2019-07-21 02:02:50.693[1099]调试[dogpile.lock]无值,正在等待创建锁
2019-07-21 02:02:50.694[1099]调试[dogpile.lock]获得价值创造锁
2019-07-21 02:02:50.694[1099]调试[dogpile.lock]调用尚未显示值的创建函数
2019-07-21 02:02:50.694[1099]调试[dogpile.lock]释放创建锁
2019-07-21 02:02:50.695[1099]信息[vcsserver.tweens]IP:127.0.0.1请求路径:`/git`时间:0.002s
2019-07-21 02:02:50.695[]GNCRN 127.0.0.1 rqt:0.00251720051“POST:/git”usr:-“-”PycURL/7.43.0.2 libcurl/7.59.0 OpenSSL/1.0.2p zlib/1.2.11 libssh2/1.8.0 nghttp2/1.24.0”
2019-07-21 02:02:50.869[1099]调试[vcsserver.http_main]http应用程序:处理git流
2019-07-21 02:02:50.869[1099]调试[vcsserver.http_main]LFS:根据内容类型检测请求`/other test/info/refs`是否为LFS服务器路径:``,是否为_LFS:False
2019-07-21 02:02:50.869[1099]调试[vcsserver.http_main]LFS:通过路径“/other test/info/refs”进行的回退检测是否为“False”
2019-07-21 02:02:50.869[1099]调试[vcsserver.http_main]http应用程序:启动应用程序处理程序并处理请求
2019-07-21 02:02:50.878[1099]信息[vcsserver.tweens]IP:127.0.0.1请求路径:`/other test/INFO/refs`时间:0.010s
2019-07-21 02:02:50.879[]GNCRN 127.0.0.1 rqt:0.010726 200 38“获取:/other test/info/refs service=git upload pack”usr:-“-”git/2.20.1(苹果git-117)
编辑:目前,我正在通过
git config--global credential.helper store
(从我的本地机器)使用存储的git凭据,以便克隆我的私有repo。不过这是不希望的,SSH操作应该可以工作

编辑2:我还没有得到这个或RhodeCode令牌来工作,所以git凭据就是这样。如果我找到了问题/解决方案,我会在这里更新

我想也许我应该使用
ssh.authorized\u keys\u file\u path

您应该确保公钥位于
ssh.authorized\u keys\u file\u path
文件中,即
~/.ssh/authorized\u keys\u code

如果使用
rccontrol enable module ssh{instance id}
,则无需触摸
rhode.ini
,如图所示

问题是:


SSH已在我的实例上启用。这个LFS错误真的是我无法克隆的原因吗?我已经在管理区域选择了相关选项。@NetOperatorWibby是的,我怀疑错误LFS是相关的,但我还不知道它为什么或如何干扰SSH克隆。我在设置中关闭了LFS,创建了一个全新的repo,并通过web界面添加了提交。但是,没有骰子。我会继续四处看看。