Need authentication help with the drone-scp plugin

Drone version: 0.8

I’m trying to deploy to my server through the drone-scp plugin, but I’m having trouble with authenticating. I have no trouble using scp manually from my local machine -> remote server. But with Drone and drone-scp, I wonder if I’m missing a step somewhere or some sort of detail.

Here’s the error message:

drone-scp error:  error copy file to dest: <MY_SERVER_IP>, error message: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain

Here is my .drone.yml:

pipeline:
  scp:
    image: appleboy/drone-scp
    host: <MY_SERVER_IP>
    username: <USERNAME>
    port: 22
    source:
      - ./
    target:
      - /home/<USERNAME>
    secrets:
      - source: deploy_key
        target: ssh_key

On my server, I add the secret for the ssh_key using the following command:

drone secret add --repository <MY_REPO> --name deploy_key --value @/home/<USERNAME>/.ssh/id_rsa

Let me know how else I can help you help me. Thanks!

I realized my mistake. I was suppose to add the private key on my local machine, not the one on my remote server. That’s how Drone can verify the public key stored on server.