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:
-
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.
-
Add Codeberg to Known Hosts: You need to add Codeberg's SSH key to the
known_hostsfile 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_hostsfile:ssh [email protected]You should see a message asking if you want to continue connecting. Type
yesto add Codeberg's host key to theknown_hostsfile.
-
-
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. -
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.
-
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.