Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Why is git pull/push not working on PowerShell, but does on git bash (Windows 10)?

Deleted user September 6, 2018

I have the issue that I am unable to git push/pull in Powershell due to the following error:

git@bitbucket.org: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

 I've run though all the troubleshooting steps to add my private key using `ssh-add`, and the corresponding public key to bitbucket settings. No dice. I've also run `ssh -T -v git@bictbucket.org` and get the following output (edited slightly to remove my personal details), that appears to indicate it has managed to communicate with bitbucket correctly:

OpenSSH_for_Windows_7.6p1, LibreSSL 2.6.4
debug1: Connecting to bitbucket.org [18.205.93.1] port 22.
debug1: Connection established.
debug1: identity file C:\\Users\\<USERNAME>/.ssh/id_rsa type 0
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\<USERNAME>/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\<USERNAME>/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\<USERNAME>/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\<USERNAME>/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\<USERNAME>/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\<USERNAME>/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\<USERNAME>/.ssh/id_ed25519-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_for_Windows_7.6
debug1: Remote protocol version 2.0, remote software version abcxyz_1.1.13-7af6557 app-133
debug1: no match: abcxyz_1.1.13-7af6557 app-133
debug1: Authenticating to bitbucket.org:22 as 'git'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256@libssh.org
debug1: kex: host key algorithm: ssh-rsa
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ssh-rsa SHA256:zzXQOXSRBEiUtuE8AikJYKwbHaxvSc0ojez9YXaGp1A
debug1: Host 'bitbucket.org' is known and matches the RSA host key.
debug1: Found key in C:\\Users\\<USERNAME>/.ssh/known_hosts:1
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: RSA SHA256:37tTWM0X/SH88HUXX5sc0K6kvZU1dQw8ZkpFax6UqOw C:\\Users\\<USERNAME>/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 279
debug1: Authentication succeeded (publickey).
Authenticated to bitbucket.org ([18.205.93.1]:22).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: pledge: network
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: channel 0: free: client-session, nchannels 1
Transferred: sent 2456, received 1848 bytes, in 2.3 seconds
Bytes per second: sent 1053.7, received 792.8
debug1: Exit status 0

 Now I can push/pull from Sourcetree (using Putty ssh agent), and from Git Bash. As far as I can tell the only difference with Git Bash is that it uses OpenSSH_7.7p1 instead of OpenSSH_for_Windows_7.6p1, otherwise I follow exactly the same steps and I'm unable to git pull/push on Powershell, but able to on Git Bash.

Any help getting my git pull/push to work on powershell would be appreciated.

1 answer

0 votes
Gabor Szegedi December 2, 2021

Hey! I have the exact same issue. Have you found an answer for this one?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events