Deploying with SSH

1 minute read

Using SSH/SCP To Deploy

To deploy using SSH and SCP with CloudBees CodeShip Pro, you will need to create a container that can connect to your server via SSH. Then, you will pass this container the necessary deployment commands.

Please follow our outlined steps on setting your private SSH key before proceeding


After the private SSH key configuration is complete, you can add SSH/SCP deploy commands to the codeship-steps.yml file:

- name: Copy Files service: app command: scp -r /app/ - name: Restart Server service: app command: ssh restart_server

Common Problems

Authentication Failure

If your SSH authentication commands are failing, there are several troubleshooting steps to take.

  • First, try connecting using that key locally to verify the key and the corresponding public key are configured and working as intended.

  • Next, try running your deployments locally with our local CLI tool to see if you receive the same error messages.

  • Ensure that your target endpoints are acknowledged in your $HOME/.ssh/known_hosts.

  • Often times these issues are related to character escaping or issues loading the key into the proper directory, so running printenv and ls commands will help you verify that the correct key has been loaded and that it is where you want it to be.