Deploying artifacts using SCP
SCP is a means of transferring files between two host computers. This protocol uses SSH as a foundation to securely move files from one computer to another.
Let’s learn how to transfer a build artifact from Bitbucket Cloud to the remote host using SCP.
Getting ready
Because the foundation of SCP is SSH, we need to prepare an SSH key and other configurations related to SSH on both Bitbucket and the remote host. Let’s take a look at the necessary steps:
- We defined a repository SSH key in the Getting ready section of the Pushing artifacts into the Bitbucket repository recipe. We can use this key for transfer to the remote host by copying the public key and placing it in the
~/.ssh/authorized_keys
file. If you have SSH access to the remote host, run the following command from the machine where you generated the key pair. This mandates that the user performing the operation will be you:ssh-copy-id -i <public key file to copy...