title: connect bitbucket pipeline to cpanel with API keys
body: <p>How do I use SSH Keys (created from cPanel) to connect to the server? And eventually pull a fresh copy and run composer updates and database migrations (a Symfony script)</p>
  <p>I get permission denied errors so my <code>ssh example.net.au ls -l /staging.example.net.au</code> is reaching the server, I'm just unsure how to use keys made from cPanel to make an authentication.</p>
  <p><strong>bitbucket-pipelines.yml</strong></p>
  <pre><code># This is an example Starter pipeline configuration
  # Use a skeleton to build, test and deploy using manual and parallel steps
  # -----
  # You can specify a custom docker image from Docker Hub as your build environment.
  image: atlassian/default-image:2
  
  pipelines:
    default:
      - parallel:
        - step:
            name: 'Build and Test'
            script:
              - echo &quot;Your build and test goes here...&quot;
        - step:
            name: 'Lint'
            script:
              - echo &quot;Your linting goes here...&quot;
        - step:
            name: 'Security scan'
            script:
              - echo &quot;Your security scan goes here...&quot;
  
      # The following deployment steps will be executed for each pipeline run. To configure your steps and conditionally deploy see https://support.atlassian.com/bitbucket-cloud/docs/configure-bitbucket-pipelinesyml/
      - step:
          name: 'Deployment to Staging'
          deployment: staging
          script:
            - echo &quot;Your deployment to staging script goes here...&quot;
            - echo $TESTVAR
            - ssh example.net.au ls -l /staging.example.net.au
      - step:
          name: 'Deployment to Production'
          deployment: production
          trigger: 'manual'
          script:
            - echo &quot;Your deployment to production script goes here...&quot;
  
  </code></pre>