reifyhealth / lein-git-down

A Leiningen plugin for resolving dependencies from Git
MIT License
82 stars 6 forks source link

Recommended ~/.ssh/config #25

Closed vemv closed 5 years ago

vemv commented 5 years ago

Hey there,

although lein-git-down works fine with private repos and a default ~/.ssh/config, if the user was using a custom cypher suite, then it becomes non-trivial to figure out how to cleanly make lein-git-down use a compatible suite.

e.g. given the following contents:

Host * !github.com
  HostKeyAlgorithms ssh-ed25519-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-ed25519,ssh-rsa
  Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr
  MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,umac-128@openssh.com
  KexAlgorithms curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1

Which should not affect lein-git-down (given ! syntax), lein-git-down will be unable to retrieve repos.

I figured out that the following snippet works fine, and is able to coexist with the one above:

Host github.com
  HostKeyAlgorithms ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
  Ciphers aes128-ctr,aes192-ctr,aes256-ctr
  MACs hmac-sha2-256,hmac-sha1
  KexAlgorithms ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1

I created this snippet by taking the original one, and following the Detected unsupported algorithm(s) warnings, removing the indicated problematic items, e.g {"hmac-sha2-256-etm@openssh.com" "umac-128-etm@openssh.com" "hmac-sha2-512-etm@openssh.com" "umac-128@openssh.com" "hmac-sha2-512"}.

That was grunt work, and possibly a non-intuitive fix for newcomers.

I suggest the Host github.com snippet is added to the README, wiki or such.

Cheers - Victor

jwkoelewijn commented 5 years ago

+1, would help a lot!

vemv commented 5 years ago

Hey there,

any luck with the two last issues I created?

cc/ @manderson202

Thanks!

manderson202 commented 5 years ago

Hey @vemv, sorry for not getting back on these. I've been swamped lately. I'll try and take a look this week. Thanks for following up!

manderson202 commented 5 years ago

This was just merged. Thanks for the snippet!