I'm trying to push several files to a repository over SSH (PuTTY/plink). When I do this, the push fails with the following output:
git -c diff.mnemonicprefix=false -c core.quotepath=false push -v --set-upstream origin refactoring:feature/<repo_name>
Pushing to ssh://<bitbucket_server_name>:7999/xxx/xxx_xxx_xxx.git
The host key is not cached for this server:
<bitbucket_server_name> (port 7999)
You have no guarantee that the server is the computer
you think it is.
The server's rsa2 key fingerprint is:
ssh-rsa 2048 SHA256:am2ymdBXeGm6NjLuVDHN6pI8WsIvrIkoSeFm6Q4KZc0
If you trust this host, enter "y" to add the key to
Completed with errors, see above.
PuTTY's cache and carry on connecting.
If you want to carry on connecting just once, without
adding the key to the cache, enter "n".
If you do not trust this host, press Return to abandon the
connection.
Store key in cache? (y/n, Return cancels connection, i for more info) fatal: Could not read from remote repository.Please make sure you have the correct access rights
and the repository exists.
I've tried using Embedded Git and plink'ing to bitbucket.org as stated in https://confluence.atlassian.com/sourcetreekb/trust-a-server-s-host-key-when-no-button-is-available-to-trust-it-788731545.html, but neither work (I'm already using Embedded Git; no popup appears)
I've also tried manually plink'ing to the repository, but I get the following error:
FATAL ERROR: Network error: Connection refused
How can I fix this?
Turns out the solution is to install PuTTY and connect through that so the option to trust the host appears.
Then recreate the public and private keys via PuTTYgen , add the public key to my Bitbucket account on the server, then add the private key to Pageant, as per the steps in this answer:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.