Search code examples
gitjbpmwildfly-10kiekie-workbench

Can not clone repository from KIE workbench with git using ssh


I am using jbpm 6.5.0, and am on ubuntu 20.10 (64bit)

I have downloaded and ran the KIE workbench server on localhost with wildfly, and created a repository on the admin account, however when I try to clone, I get an error:

$ 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.

Here is a debugging log I got.

$ 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

Any help would be much appreciated.


Solution

  • So, answering my own question here since I found the solution.

    Steps:

    1. Stop the server.

      ant stop.demo
      
    2. Delete .security folder (hidden folder located under the install folder)

      rm -rf .security
      
    3. Add the following property in standalone-full.xml under the <system-properties> section. For me this file was located in (install folder)/wildflyxxx/standalone/configuration

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

      However, if you are missing the <system-properties> section, you can add it AFTER the <extensions> section.

      <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>
      

      I'm not actually sure if it matters where you add it or if you need the additional property fields, but that's what ended up working for me.

    4. Start the server again, and git clone and such should work now using an RSA key.