I try to make git ftp push pipline work from bitbucket to aws lightsail with a bitnami image. I followed the steps here, but cannot find my error:
https://community.atlassian.com/t5/Bitbucket-questions/Pipeline-git-ftp-sftp-SSH-keys-convert-to-PEM/qaq-p/1480543
my yml file looks like this:
image: php:7.3.5
pipelines:
branches:
master:
- step:
name: Deploy to aws lightsail bitnami production
deployment: production
script:
- apt-get update
- apt-get -qq install git-ftp
- apt-get install -y ssh
A connection is made, but it seems the public key cannot be found. I created a SSH Pipline key and a fingerprint in repro settings->pipeline.
And I copied the public key to the home/bitnami/.ssh/authorized_keys file with nano.
PS:
<span>I answered my question myself. Still I wonder where the public key is. The solution I found just recreates the public key - can this be on purpose? So if anybody knows the internals, I would be very interested what the path of the public key is. I revert my mark as answer so somebody still gets the credits if answerting.</span>
<span>Thanks!</span>
The exact error message is here:
<span>+ git ftp push -vv -u bitnami --key /opt/atlassian/pipelines/agent/ssh/id_rsa sftp://x.x.x.x:22/opt/bitnami/wordpress/wp-content</span>
<span>Mon Oct 25 11:10:55 UTC 2021: git-ftp version 1.3.1 running on Linux xxxxxxxxxxxxxxxxx-ffdnv 5.6.0 #1 SMP Thu Nov 12 07:09:22 UTC 2020 x86_64 GNU/Linux</span>
<span>Mon Oct 25 11:10:55 UTC 2021: Host is 'x.x.x.x:22'.</span>
<span>Mon Oct 25 11:10:55 UTC 2021: User is 'bitnami'.</span>
<span>Mon Oct 25 11:10:55 UTC 2021: No password is set.</span>
<span>Mon Oct 25 11:10:55 UTC 2021: Using ssh private key file /opt/atlassian/pipelines/agent/ssh/id_rsa</span>
<span>Mon Oct 25 11:10:55 UTC 2021: Using ssh public key file /opt/atlassian/pipelines/agent/ssh/id_rsa.pub</span>
<span>Mon Oct 25 11:10:55 UTC 2021: Added missing trailing / in path.</span>
<span>Mon Oct 25 11:10:55 UTC 2021: Path is 'opt/bitnami/wordpress/wp-content/'.</span>
<span>Mon Oct 25 11:10:55 UTC 2021: Syncroot is ''.</span>
<span>Mon Oct 25 11:10:55 UTC 2021: The remote sha1 is saved in file '.git-ftp.log'.</span>
<span>Mon Oct 25 11:10:55 UTC 2021: CACert is ''.</span>
<span>Mon Oct 25 11:10:55 UTC 2021: Insecure is ''.</span>
<span>Mon Oct 25 11:10:55 UTC 2021: Retrieving last commit from sftp://bitnami:***@3.125.44.139:22/opt/bitnami/wordpress/wp-content/.</span>
<span>* Trying x.x.x.x...</span>
<span>* TCP_NODELAY set</span>
<span>* Connected to x.x.x.x (x.x.x.x) port 22 (#0)</span>
<span>* SSH MD5 fingerprint: xxxxxx</span>
<span>* SSH authentication methods available: publickey</span>
<span>* Using SSH public key file '/opt/atlassian/pipelines/agent/ssh/id_rsa.pub'</span>
<span>* Using SSH private key file '/opt/atlassian/pipelines/agent/ssh/id_rsa'</span>
<span>* SSH public key authentication failed: Unable to open public key file</span>
<span>* Failure connecting to agent</span>
<span>* Authentication failure</span>
<span>* Closing connection 0</span>
<span>curl: (67) Authentication failure</span>
<span>Mon Oct 25 11:10:56 UTC 2021: fatal: Could not get last commit. Network down? Wrong URL? Use 'git ftp init' for the initial push., exiting...</span>