Qt Creator: "Host key verification failed" for remote git operations that work from the command line
-
I have this weird issue with one of my Git repositories: Attempts to push to or pull from the remote through Qt Creator, fail with a message like:
ssh_askpass: exec(win-ssh-askpass): No such file or directory
Host key verification failed.
fatal: Could not read from remote repository.Please make sure you have the correct access rights
and the repository exists.
The command "C:\Program Files\Git\cmd\git.exe push" terminated with exit code 128.If I enter "git push" or "git pull" in a terminal window, I don't get this however; the commands just work, and I'm not asked for a password - which is the way I expect it because I've set up for authentication using tokens.
I have other repos cloned from the same server, and I don't get the same problem there.
This is with the Windows version of Qt Creator (as you may have gathered from the error messages.) Currently using version 14.0.2, but I also had this with past releases.
Any ideas what may be going on?
-
Do you by chance have multiple git and/or ssh binaries? Your description just sounds like as if Creator uses a git with a different SSH configuration.
What happens if you open git bash (In Creator: Tools > Git > Git Tools > Git Bash) and repeat the pull/push from there?
-
From Git bash, the git operations work...
Yes, it turns out that I have two ssh binaries.
$ where ssh C:\Program Files\Git\usr\bin\ssh.exe C:\Windows\System32\OpenSSH\ssh.exe
But if Qt Creator uses the wrong ssh, why does everything work with all my other repos?
-
I believe I have found it: What actually happens, is that for some reason, a different home directory is assumed when git is executed from Qt Creator. That triggers a host key verification error because the location in question doesn't have an
.ssh/known_hosts
file with a key for the git host, and unlike when the command is started from a shell, the information isn't downloaded automatically.SSH config does exist on the location in question, though, as it was used as home in the past. That's how git operations work for other repos; it turns out that there is a subtle difference in their
.git/config
, in that another alias is listed for the remote host, and the name in question appears in the "alternative"known_hosts
. -
The problem is the Set "HOME" option here:
(from Version Control in Preferences dialog.)
The tooltip for this option suggests that it will set HOME to the location I want, but it seems like it doesn't really. Instead it changes HOME from the desired location to something else. If I uncheck, everything works a lot better.
Perhaps part of the issue is that I didn't update everything fully when I tried to change my home directory earlier. Not sure what to do, there, really...
-
A aha_1980 has marked this topic as solved on