esc esc - 1 year ago 203
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 ' (' 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 Source

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

ssh-keyscan -t rsa >>~/.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 host (or in general, but that seems riskier)

    StrictHostKeyChecking no
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download