无法使用 ssh 使用 git 从 KIE workbench 克隆存储库

Can not clone repository from KIE workbench with git using ssh

我正在使用 jbpm 6.5.0,并且在 ubuntu 20.10(64 位)

我已经使用 wildfly 在本地主机上下载并 运行 KIE workbench 服务器,并在管理员帐户上创建了一个存储库,但是当我尝试克隆时,出现错误:

$ git clone ssh://admin@localhost:8001/testRepo
Cloning into 'testRepo'...
Connection closed by 127.0.0.1 port 8001
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

这是我得到的调试日志。

$ ssh admin@localhost -p 8001 -v
OpenSSH_8.3p1 Ubuntu-1, OpenSSL 1.1.1f  31 Mar 2020
debug1: Reading configuration data /home/jiahao/.ssh/config
debug1: /home/jiahao/.ssh/config line 1: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug1: Connecting to localhost [127.0.0.1] port 8001.
debug1: Connection established.
debug1: identity file /home/jiahao/.ssh/id_rsa type -1
debug1: identity file /home/jiahao/.ssh/id_rsa-cert type -1
debug1: identity file /home/jiahao/.ssh/id_dsa type -1
debug1: identity file /home/jiahao/.ssh/id_dsa-cert type -1
debug1: identity file /home/jiahao/.ssh/id_ecdsa type -1
debug1: identity file /home/jiahao/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/jiahao/.ssh/id_ecdsa_sk type -1
debug1: identity file /home/jiahao/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /home/jiahao/.ssh/id_ed25519 type -1
debug1: identity file /home/jiahao/.ssh/id_ed25519-cert type -1
debug1: identity file /home/jiahao/.ssh/id_ed25519_sk type -1
debug1: identity file /home/jiahao/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /home/jiahao/.ssh/id_xmss type -1
debug1: identity file /home/jiahao/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.3p1 Ubuntu-1
debug1: Remote protocol version 2.0, remote software version SSHD-CORE-0.12.0
debug1: no match: SSHD-CORE-0.12.0
debug1: Authenticating to localhost:8001 as 'admin'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: ecdh-sha2-nistp256
debug1: kex: host key algorithm: ssh-dss
debug1: kex: server->client cipher: aes128-ctr MAC: hmac-sha2-256 compression: none
debug1: kex: client->server cipher: aes128-ctr MAC: hmac-sha2-256 compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
Connection closed by 127.0.0.1 port 8001

如有任何帮助,我们将不胜感激。

既然我找到了解决方案,那么在这里回答我自己的问题。

步骤:

  1. 停止服务器。

    ant stop.demo
    
  2. 删除 .security 文件夹(位于安装文件夹下的隐藏文件夹)

    rm -rf .security
    
  3. 部分下的 standalone-full.xml 中添加以下 属性。对我来说,这个文件位于(安装文件夹)/wildflyxxx/standalone/configuration

    <property name="org.uberfire.nio.git.ssh.algorithm" value="RSA"/>
    

    但是,如果您缺少 部分,您可以在 部分之后添加它。

    <system-properties>
         <property name="org.uberfire.nio.git.daemon.host" value="127.0.0.1"/>
         <property name="org.uberfire.nio.git.ssh.host" value="127.0.0.1"/>
         <property name="org.kie.demo" value="false"/>
         <property name="org.kie.example" value="false"/>
         <property name="org.uberfire.nio.git.ssh.enabled" value="true"/>
         <property name="org.uberfire.nio.git.ssh.algorithm" value="RSA"/>
    </system-properties>
    

    我实际上不确定添加它的位置是否重要,或者您是否需要额外的 属性 字段,但这就是最终对我有用的东西。

  4. 再次启动服务器,git克隆等现在应该可以使用 RSA 密钥工作了。