Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dokku clone failing because of ssh fingerprint #46

Open
iloveitaly opened this issue Feb 3, 2020 · 13 comments
Open

dokku clone failing because of ssh fingerprint #46

iloveitaly opened this issue Feb 3, 2020 · 13 comments
Labels
enhancement New feature or request

Comments

@iloveitaly
Copy link
Contributor

When I tried to use dokku clone, the task hung indefinitely when it was run via ansible. There was no error or debugging output available when ansible was run with -vvvv so I attempted to run the same command directly via ssh.

I ran into this error:

The authenticity of host 'github.com (140.82.114.3)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.

It looks like there already exists a check to ensure github.com is added to known_hosts, but if a user has FingerprintHash md5 the known_hosts value is invalid.

I'm guessing what we need to do here is somehow check the FingerprintHash setting and change what line we are checking for in known_hosts, but my ansible knowledge isn't advanced enough to understand how to make this change. Any ideas? Happy to contribute if you push me in the right direction!

@josegonzalez
Copy link
Member

Where is FingerprintHash md5 set?

@iloveitaly
Copy link
Contributor Author

I don't understand openssl very well at all, but it looks like this can be defined on a per-host basis in ~/.ssh/config. I imagine there are a bunch of other places config could live, and I think it can be defined on a per-request basis as well.

I bet there's some sort of call you could make to query openssl configuration to ask what FingerprintHash method is used, but I wasn't able to find anything obvious with some googling.

@josegonzalez
Copy link
Member

Maybe something like this? https://stackoverflow.com/a/38462337/1515875

@iloveitaly
Copy link
Contributor Author

Something like that could work, but I wonder if there's a better way to check what fingerprints are used outside of checking config files. Then we could conditionally add a value to known_hosts and avoid having to update the scripts if openssl changes how/where the fingerprint configuration is stored.

@josegonzalez
Copy link
Member

Well we could move the fingerprint to a variable and conditionally use one variable if the fingerprint is sha56 and another for md5 etc.?

@iloveitaly
Copy link
Contributor Author

Yeah, I think that would work great. Just thinking about the best way to determine the fingerprint for github.com as it can be defined on a per-host basis. I guess we could just grep the whole file and trust that fingerprint is set once, that value is used consistently, but I'm hoping there's some sort of ssh/openssl command which can determine this config for us

@ltalirz
Copy link
Member

ltalirz commented Sep 2, 2021

Just letting you know that dokku_clone just moved to use the new dokku git:sync command under the hood #98

I guess this issue won't be solved by this, so this is just fyi

@ltalirz ltalirz added the enhancement New feature or request label Sep 4, 2021
@fr3fou
Copy link
Contributor

fr3fou commented Nov 14, 2021

Is there any workaround to solve this temporarily?

@ltalirz
Copy link
Member

ltalirz commented Nov 14, 2021

I guess to configure sha256 as the hash algorithm for OpenSSL?

Haven't encountered the issue myself so far, so I don't know the best way to do this

@fr3fou
Copy link
Contributor

fr3fou commented Nov 14, 2021

How would I do that? I can't seem to understand the problem to be honest. I've been manually fixing it by ssh-ing into my VPS and cloning my repo just to hit yes here
image
then deleting the repo and re-running my playbook.

@ltalirz
Copy link
Member

ltalirz commented Nov 14, 2021

As I understand https://superuser.com/a/929567 it would be and ~/.ssh/config with

Host github.com
    FingerprintHash md5

@fr3fou
Copy link
Contributor

fr3fou commented Nov 14, 2021

As I understand https://superuser.com/a/929567 it would be and ~/.ssh/config with

Host github.com
    FingerprintHash md5

would this be for the dokku user?

@josegonzalez
Copy link
Member

Something like this would work: https://gist.github.com/maxim/871e611d4bc02c633c67

Here are the fingerprints as documented by github: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/githubs-ssh-key-fingerprints

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants