esc esc - 3 months ago 59
Git Question

How to inject ssh options to pip install git+ssh

I have a newely provisioned AWS instance. I am trying to install an application using the

pip install git+ssh syntax
using ansible. However, ansible hangs. Upon further investigation, ansible hangs because:


The authenticity of host 'github.com (192.30.253.113)' can't be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)?


So my question is, how to inject an ssh option such as
-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no
into the pip command?

Alternative solutions will also be considered.

Answer

You can grab the fingerprint via ssh-keyscan and put it into the known_hosts file yourself.

ssh-keyscan -t rsa github.com >>~/.ssh/known_hosts

This way ssh is already happy with the key and you don't have to remember to add options every time.

But if you'd just rather ignore anything fingerprint-related, it should also work if you add the option in your ~/.ssh/config under the github.com host (or in general, but that seems riskier)

Host github.com
    StrictHostKeyChecking no
Comments