'Cannot clone from Bitbucket via SSH anymore - [email protected]: Permission denied (publickey)
I had been using both https and ssh without any issues up until 3 days ago. My ssh is not working anymore (https works). I cannot clone, push, fetch, etc. When I do one of those operations, I am getting:
ssh: connect to host bitbucket.**.*****.com port 22: Operation timed out
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
I have the access rights. I had been working with this repository for the past 3 months. Now, suddenly, I cannot. I am thinking that there is a problem with authorization. I am running the command:
ssh -T [email protected]
and getting:
[email protected]: Permission denied (publickey).
I have spent past 3 days trying to fix the issue. Cannot figure it out. Here is what I have tried so far:
Checked Windows Firewall to see if port 22 is blocked with
netsh firewall show state. I do not see port 22 blocked there.Added port 443 to my config file. No results. My config file
~/.ssh/config:Host bitbucket.org Hostname altssh.bitbucket.org Port 443 IdentityFile ~/.ssh/id_rsaTried to push, clone, fetch, etc with my mobile phone's internet connection via hotspot. I thought may be it is because of my connection. But the problem persists even with my mobile internet connection.
Checked the issue on MacOS as well with the same account. The same problem on MacOS.
Restarted my device multiple times. No results.
Removed and reinstalled Git. No results.
Generated new keys and went through the whole create and add
sshprocess multiple times. Completely removed all of mysshkeys from Bitbucket and re-added fresh ones as part of this step as well.I have made sure that I am using correct email and correct
sshkeys.Used
ssh-addcommands to list and add keys.Made sure that only one
ssh-agentis running.I have gone though the
sshtroubleshooting guide from Bitbucket. No results.Tried with
ED25519algorithm other thanRSA. No results.Tried many more other stuff which I cannot remember now...
When run the command:
ssh -i ~/.ssh/id_rsa -vT [email protected]
getting the following:
OpenSSH_8.8p1, OpenSSL 1.1.1m 14 Dec 2021
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to bitbucket.org [104.192.141.1] port 22.
debug1: Connection established.
debug1: identity file /c/Users/Work/.ssh/id_rsa type 0
debug1: identity file /c/Users/Work/.ssh/id_rsa-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.8
debug1: Remote protocol version 2.0, remote software version conker_daf2fe3bd1 cd33c1e46308
debug1: compat_banner: no match: conker_daf2fe3bd1 cd33c1e46308
debug1: Authenticating to bitbucket.org:22 as 'git'
debug1: load_hostkeys: fopen /c/Users/Work/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: [email protected]
debug1: kex: host key algorithm: rsa-sha2-512
debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none
debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: SSH2_MSG_KEX_ECDH_REPLY received
debug1: Server host key: ssh-rsa SHA256:zzXQOXSRBEiUtuE8AikJYKwbHaxvSc0ojez9YXaGp1A
debug1: load_hostkeys: fopen /c/Users/Work/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
debug1: Host 'bitbucket.org' is known and matches the RSA host key.
debug1: Found key in /c/Users/Work/.ssh/known_hosts:1
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: Will attempt key: /c/Users/Work/.ssh/id_rsa RSA SHA256:OR3NNNc3p9PBkLD0Riffw4/+LzLerineyjmhvwrGkJE explicit
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ecdsa-sha2-nistp256,[email protected],[email protected],ecdsa-sha2nistp384,ecdsa-sha2-nistp521,[email protected],[email protected],ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,[email protected]>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /c/Users/Work/.ssh/id_rsa RSA SHA256:OR3NNNc3p9PBkLD0Riffw4/+LzLerineyjmhvwrGkJE explicit
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.
[email protected]: Permission denied (publickey).
When run the command:
ssh -vT [email protected]
getting the following:
OpenSSH_8.8p1, OpenSSL 1.1.1m 14 Dec 2021
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to bitbucket.org [104.192.141.1] port 22.
debug1: Connection established.
debug1: identity file /c/Users/Work/.ssh/id_rsa type 0
debug1: identity file /c/Users/Work/.ssh/id_rsa-cert type -1
debug1: identity file /c/Users/Work/.ssh/id_dsa type -1
debug1: identity file /c/Users/Work/.ssh/id_dsa-cert type -1
debug1: identity file /c/Users/Work/.ssh/id_ecdsa type -1
debug1: identity file /c/Users/Work/.ssh/id_ecdsa-cert type -1
debug1: identity file /c/Users/Work/.ssh/id_ecdsa_sk type -1
debug1: identity file /c/Users/Work/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /c/Users/Work/.ssh/id_ed25519 type -1
debug1: identity file /c/Users/Work/.ssh/id_ed25519-cert type -1
debug1: identity file /c/Users/Work/.ssh/id_ed25519_sk type -1
debug1: identity file /c/Users/Work/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /c/Users/Work/.ssh/id_xmss type -1
debug1: identity file /c/Users/Work/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.8
debug1: Remote protocol version 2.0, remote software version conker_daf2fe3bd1 84be4084d9fd
debug1: compat_banner: no match: conker_daf2fe3bd1 84be4084d9fd
debug1: Authenticating to bitbucket.org:22 as 'git'
debug1: load_hostkeys: fopen /c/Users/Work/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: [email protected]
debug1: kex: host key algorithm: rsa-sha2-512
debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none
debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: SSH2_MSG_KEX_ECDH_REPLY received
debug1: Server host key: ssh-rsa SHA256:zzXQOXSRBEiUtuE8AikJYKwbHaxvSc0ojez9YXaGp1A
debug1: load_hostkeys: fopen /c/Users/Work/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
debug1: Host 'bitbucket.org' is known and matches the RSA host key.
debug1: Found key in /c/Users/Work/.ssh/known_hosts:1
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: Will attempt key: /c/Users/Work/.ssh/id_rsa RSA SHA256:OR3NNNc3p9PBkLD0Riffw4/+LzLerineyjmhvwrGkJE
debug1: Will attempt key: /c/Users/Work/.ssh/id_dsa
debug1: Will attempt key: /c/Users/Work/.ssh/id_ecdsa
debug1: Will attempt key: /c/Users/Work/.ssh/id_ecdsa_sk
debug1: Will attempt key: /c/Users/Work/.ssh/id_ed25519
debug1: Will attempt key: /c/Users/Work/.ssh/id_ed25519_sk
debug1: Will attempt key: /c/Users/Work/.ssh/id_xmss
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<[email protected],ssh-rsa,rsa-sha2-256,rsa-sha2-512,ecdsa-sha2-nistp521,[email protected],[email protected],ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,[email protected],[email protected]>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /c/Users/Work/.ssh/id_rsa RSA SHA256:OR3NNNc3p9PBkLD0Riffw4/+LzLerineyjmhvwrGkJE
debug1: Authentications that can continue: publickey
debug1: Trying private key: /c/Users/Work/.ssh/id_dsa
debug1: Trying private key: /c/Users/Work/.ssh/id_ecdsa
debug1: Trying private key: /c/Users/Work/.ssh/id_ecdsa_sk
debug1: Trying private key: /c/Users/Work/.ssh/id_ed25519
debug1: Trying private key: /c/Users/Work/.ssh/id_ed25519_sk
debug1: Trying private key: /c/Users/Work/.ssh/id_xmss
debug1: No more authentication methods to try.
[email protected]: Permission denied (publickey).
It is the same PC. I did not touch or change anything on my set-up. The only thing might have happened without my control is Windows update. Can Windows update (possibly) cause such an issue?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
