Hi everyone,
I have a SSH Key setup in my repository for which the deploy on the remote server works fine.
Now I'm trying to set a new SSH key to deploy the changes on a new server. I followed the instructions in the documentation below but I can't get it work. Pipeline fails with "Permission denied (public key)" error.
https://support.atlassian.com/bitbucket-cloud/docs/use-multiple-ssh-keys-in-your-pipeline/
The private key has been correctly encoded and added as a secure variable, no doubt about this.
The public key is installed on the remote host on ~/.ssh/authorized_keys
I'm not sure about the "my_known_hosts" file. I've generated this file on the local machine by specifying the correct host and I committed to my repository. The public key in "my_known_hosts" file is different than one from "~/.ssh/authorized_keys".
In the remote server I don't have any "know_hosts" file and I'm not sure if I should have.
Any help would be greatly appreciated
Hello @Andrei Henea ,
thank you for reaching out to Community!
Could you add the following ssh command in your pipeline, run it again, and share with us the full log output?
ssh -Tvvv <user>@<host>
This will include verbose logs in the SSH command which will include additional information that can help on the investigation, such as which key SSH is trying to use, and also if your server's fingerprint were correctly validated in the known_hosts file.
When sharing the logs here, please make sure to sanitize any sensitive information (IP address, username, repository, etc) as this is a public forum :)
Thank you, @Andrei Henea !
Patrik S
Hello @Andrei Henea and thank you for reaching out to the Community!
Could you try adding the following command to your pipeline, run it again, and share the full output with us here?
ssh -Tvvv <user>@<host>
This will provide us with verbose logs of the ssh connection, including which SSH keys are being tried and also if your server's fingerprint is being correctly identified in the known_hosts file.
When sharing the logs here, please make sure to sanitize any personal information (username, public IP address, etc) as this is a public forum :)
Thank you, @Andrei Henea !
Patrik S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.