Hey guys,
since two days im now searching for any solution for my issue.
I'm trying to connect from the CD pipeline to the remote host via ssh to deploy a new package but the connection does not work properly.
I created a public/private key pair, without passphrase, and pasted the public key to the authorized_keys on the remote host. I also checked connecting from my local PC to the host via the same keys and it worked. Could someone help me to get it working or give me some hints to find the problem?
Thanks a lot an advance.
My Pipeline.yml:
image: atlassian/default-image:2
pipelines:
default:
- step:
script:
- ssh -v rbaptista@xxx.xxx.xxx.xxx
- echo "It works!"
Here is the error output from my pipeline:
The "xxx.xxx.xxx.xxx" is just my edited IP address.
As you can see it tells me "Authenticated with partial success.". Does anyone of you knows this error?
best regards,
Rodrigo
Hi @Rodrigo Baptista ,
it's a good case to use ssh-run pipe, where all stuff related to ssh connection from the Bitbucket Pipelines simplified for you.
script: - pipe: atlassian/ssh-run:0.2.6 variables: SSH_USER: 'rbaptista' SERVER: 'xxx.xxx.xxx.xxx' COMMAND: 'echo $HOSTNAME'
More advanced examples you can find in the ssh-run pipe's Readme.
Note! If you want to use the default behaviour for using the configured SSH key and known hosts file, you must have configured the SSH private key and known_hosts to be used for the This pipe in your Pipelines settings (see docs).
It'd be nice if you provide us with feedback about your case!
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.