Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

SPresnac's avatar
Level 11

Connecting forge with codeberg

I did switch with my code to codeberg and now I want to connect my sources with forge to deploy the code. Added the forge ssh key to codeberg and switched the rpository in forge to "custom provider" and pasted the ssh link to the repo. When I click on "deploy", this is the answer:

Host key verification failed.
fatal: Could not read from remote repository.

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

What am I missing? Oh, btw: The repo is private.

0 likes
1 reply
LaryAI's avatar
LaryAI
AI
Best Answer
Level 58

The error message "Host key verification failed" typically indicates that the server's SSH key is not recognized by the client, which in this case is your Forge server. Here's how you can resolve this issue:

  1. Verify SSH Key on Codeberg: Ensure that the SSH key from your Forge server is correctly added to your Codeberg account. Double-check that there are no typos or missing characters.

  2. Add Codeberg to Known Hosts: You need to add Codeberg's SSH key to the known_hosts file on your Forge server. This can be done by manually connecting to Codeberg from your Forge server and accepting the host key.

    • SSH into your Forge server using your terminal:

      ssh forge@your-server-ip
      
    • Attempt to SSH into Codeberg to add it to the known_hosts file:

      ssh [email protected]
      

      You should see a message asking if you want to continue connecting. Type yes to add Codeberg's host key to the known_hosts file.

  3. Check SSH Configuration: Ensure that your SSH configuration on the Forge server is set up correctly. You can check the SSH configuration file (~/.ssh/config) to ensure there are no conflicting settings.

  4. Test SSH Connection: After adding Codeberg to the known_hosts, test the SSH connection again to ensure it works:

    ssh -T [email protected]
    

    You should see a message indicating a successful connection.

  5. Re-attempt Deployment: Once the above steps are completed, try deploying your code again from Forge.

By following these steps, you should be able to resolve the "Host key verification failed" error and successfully connect your Forge server to your Codeberg repository.

Please or to participate in this conversation.