How to solve "PTY allocation request failed on channel 0 authenticated via ssh key." warning ?
Asked by Jagadeesh_ Neeruganti:

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](/t5/image/serverpage/image-id/265277iF7EDBFE83DD0B14E/image-size/large?v=v2&px=999 "MicrosoftTeams-image (18).png")


Answers:
author: Theodora Boudale
body: Hi [@Jagadeesh_ Neeruganti](/t5/user/viewprofilepage/user-id/5254310) 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**:

* <https://support.atlassian.com/bitbucket-cloud/docs/configure-ssh-and-two-step-verification/>

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

Kind regards,  
Theodora

comments: author: Jagadeesh_ Neeruganti
body: 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](https://community.atlassian.com/t5/image/serverpage/image-id/265547iA26A0BFFB7D6060E/image-size/large?v=v2&px=999 "MicrosoftTeams-image (20).png")

Can you please help me with this?


author: Theodora Boudale
body: Hi [@Jagadeesh_ Neeruganti](/t5/user/viewprofilepage/user-id/5254310),

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:

* <https://confluence.atlassian.com/bbkb/bitbucket-cloud-ssh-host-key-rotation-faq-1235851234.html>

Kind regards,  
Theodora


Tags: atl-gruland

bitbucket-cloud

cloud