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

How to solve "PTY allocation request failed on channel 0 authenticated via ssh key." warning ?

Jagadeesh_ Neeruganti
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 27, 2023

PTY allocation request failed on channel 0
authenticated via ssh key.

You can use git to connect to Bitbucket. Shell access is disabled
Connection to bitbucket.org closed.

I was trying to update the SSH key for the bitbucket to continue my work. But I am unable to do that because VS coed says Git: Host key verification failed. 

MicrosoftTeams-image (18).png

1 answer

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 28, 2023

Hi @Jagadeesh_ Neeruganti and welcome to the community.

The message PTY allocation request failed on channel 0 can be removed if you run the following command instead:

ssh -T git@bitbcuket.org

However, this specific line is not the issue. The previous lines in the output mention that there is an entry in the ~/.ssh/known_hosts file on your machine that has a different host key (probably the old key) for 18.205.93.1 (this is one of the IPs of Bitbucket Cloud).

You can open this file in an editor on your machine, remove this specific entry and save the file.

When you are getting such a warning asking you to continue the connection to Bitbucket Cloud and warning you about the fingerprint, please always ensure that the fingerprint shown in the output matches one of the fingerprints listed here in the section SSH Host Keys:

Please feel free to let me know how it goes and if you need further assistance.

Kind regards,
Theodora

Jagadeesh_ Neeruganti
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 28, 2023

When I try to push my code to my remote branch in VS code, I am getting this error. Can you please provide steps on how to add the host key? Because I am trying for the past two days, I will get the same console that I sent earlier.

MicrosoftTeams-image (20).png

Can you please help me with this?

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 28, 2023

Hi @Jagadeesh_ Neeruganti,

First, it is important to know which SSH client you are using. If you are using OpenSSH or a compatible client that uses the file ~/.ssh/known_hosts in your system, you can:

  • Remove from the ~/.ssh/known_hosts file any entry for bitbucket.org
  • Then, open this link on a browser: https://bitbucket.org/site/ssh
  • Copy and paste the content of this page at the end of your ~/.ssh/known_hosts file and save it

Afterwards, if you are getting any error about "Offending key for IP" in the ~/.ssh/known_hosts file, you will need to remove from the file this specific entry with the IP mentioned in the error message.

In case you are using another SSH client, we have an FAQ page with questions and answers about some other SSH clients:

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events