How to configure svn+ssh to work with Ubuntu 20.04?

I must be doing something daft, I cannot for the life of me get subgit with svn+ssh to work between two Ubuntu 20 boxes, now (Import fails, "error: svn: E215000: No matching credentials found." - #23 by oliver_kfs.org, see and GitHub - kfsone/subgit: Experimental setup of subgit to debug svn+ssh issues for repros)

Given the following:

svn:
  protocol: svn+ssh
  server    :  svn.int
  user: oliver
  key:
    type: rsa
    path: /home/oliver/.ssh/id-rsa-blank
    passphrase-is-blank: true
  repos:
    path: /svn/repos
    project: Proj01

I would expect to have:

[svn]
  url = svn+ssh://oliver.smith@svn.int/svn/repos/Proj01
  auth  = default

[auth "default"]
  # passwords = subgit/passwd
  useDefaultSubversionConfigurationDirectory = false
  subversionConfigurationDirectory = /home/oliver/.subversion
  userName = oliver
  sshKeyFile = /home/oliver/.ssh/id-rsa-blank
 # sshKeyFilePassphrase =      # I think it barfs if this line is uncommented
 # sshUserName = oliver          # I don't think it uses this?

but if I use this instead of a passwd file, I get:

error: svn: E210002: There was a problem while connecting to svn.int:22
error: There was a problem while connecting to svn.int:22                                                                                                                                                 error: Key exchange was not finished, connection is closed.
error: Cannot negotiate, proposals do not match.                                                                                                                                                                                error: Unexpected error has occurred; please report along with the logs ('/var/opt/gitlab/git-data/subgit/subgit-install-20220412-200316.zip')
error:   to https://support.tmatesoft.com/, thank you! 

regardless of whether the private key is in RSA or OpenSSH format, meanwhile:

$ ssh -i /home/oliver/.ssh/id-rsa-blank oliver@svn.int echo OK
OK

Am I missing something? Did I get the config options wrong?

The server - as demonstrated in the docker image at GitHub - kfsone/subgit: Experimental setup of subgit to debug svn+ssh issues - is a default ubuntu configuration, so perhaps there’s an issue with the ciphers supported by Subgit and the defaults enabled in current Ubuntnu 20.04?

Hi Oliver,

sorry to not getting back to you earlier, we were busy implementing needed changes in SubGit and testing. We haven’t yet released the new version publicly, but we are close to this and can now share the release candidate with you, here is the artefact:

use the “Login as guest” feature when it asks for authentication.
We have changes the way SubGit works with ssh and now the infamous

error: Key exchange was not finished, connection is closed.
error: Cannot negotiate, proposals do not match.

errors are gone, SubGit is able to work with those keys. I have tested the new SubGit version with the setup you shared (many thanks for that, by the way, it’s very useful!) and now import works fine.

Regarding the errors like

 E215000: No matching credentials found

or
E210002: No more authentication methods available

those may also appear due to incorrect SubGit authentication configuration, when, for example, there are several contradicting settings in the configuration file, like:

[auth "default"]
    # Passwords file path. Passwords file contains user name/password pairs that should be
    # used to log into Subversion repository.  
    passwords = subgit/passwd
    useDefaultSubversionConfigurationDirectory = false
    subversionConfigurationDirectory = /root/.subversion
    userName = svnuser
    sshKeyFile = /home/gituser/.ssh/id-rsa-pem-blank

to resolve this issue better to disable the first three lines, the ssh authentication then will work fine.

1 Like