scp-action: SCP Proxy Not working - SSH Handshake Failed

Hi,

I am getting the following error when attempting to SCP a file using a jump host (proxy):

error copy file to dest: ***, error message: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none], no supported methods remain

More details from that output:

Run appleboy/scp-action@master
  with:
    host: ***
    username: ***
    key: ***
    port: ***
    proxy_host: ***
    proxy_username: ***
    proxy_key: ***
    proxy_port: ***
    source: deploy/deploy.zip
    target: ~/
    use_insecure_cipher: false
    proxy_use_insecure_cipher: false
    timeout: 30s
    command_timeout: 10m
    rm: false
    debug: false
    strip_components: 0
    overwrite: false
    proxy_timeout: 30s
  env:
    BUILD_NUMBER: 12

redacted

tar all files into /tmp/130780587/yLVqwr7IQG.tar
scp file to server.
2020/06/30 12:57:27 error copy file to dest: ***, error message: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none], no supported methods remain
drone-scp error:  error copy file to dest: ***, error message: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none], no supported methods remain

My config:

   - name: Upload deploy to Webserver
      uses: appleboy/scp-action@master
      with:
        host: ${{ secrets.WEBSERVER_HOST }}
        username: ${{ secrets.WEBSERVER_USERNAME }}
        key: ${{ secrets.BASTION_KEY }}
        port: ${{ secrets.WEBSERVER_PORT }}
        proxy_host: ${{ secrets.BASTION_HOST }}
        proxy_username: ${{ secrets.BASTION_USERNAME }}
        proxy_key: ${{ secrets.BASTION_KEY }}
        proxy_port: ${{ secrets.BASTION_PORT }}
        source: "deploy/deploy.zip"
        target: "~/"

The really strange part is if I use ssh-action (https://github.com/appleboy/ssh-action) with the same config I can run commands just fine…

Here is that config:

- name: Connect to Webserver and deploy
      uses: appleboy/ssh-action@master
      with:
        host: ${{ secrets.WEBSERVER_HOST }}
        username: ${{ secrets.WEBSERVER_USERNAME }}
        key: ${{ secrets.BASTION_KEY }}
        port: ${{ secrets.WEBSERVER_PORT }}
        proxy_host: ${{ secrets.BASTION_HOST }}
        proxy_username: ${{ secrets.BASTION_USERNAME }}
        proxy_key: ${{ secrets.BASTION_KEY }}
        proxy_port: ${{ secrets.BASTION_PORT }}
        script: |
          ls -al

And output from that:

with:
    host: ***
    username: ***
    key: ***
    port: ***
    proxy_host: ***
    proxy_username: ***
    proxy_key: ***
    proxy_port: ***
    script: ls -al
  
    sync: false
    use_insecure_cipher: false
    timeout: 30s
    command_timeout: 10m
    proxy_timeout: 30s
    proxy_use_insecure_cipher: false
    script_stop: false
    debug: false

======CMD======
ls -al

======END======
out: total 40
out: drwxr-xr-x 5 *** *** 4096 Jun 16 08:39 .
out: drwxr-xr-x 3 root   root   4096 Jun 15 09:49 ..
out: -rw------- 1 *** ***  641 Jun 30 11:21 .bash_history
out: -rw-r--r-- 1 *** ***  ***0 Apr  4  2018 .bash_logout
out: -rw-r--r-- 1 *** *** 3771 Apr  4  2018 .bashrc
out: drwx------ 2 *** *** 4096 Jun 15 10:11 .cache
out: drwx------ 3 *** *** 4096 Jun 15 10:11 .gnupg
out: -rw------- 1 *** ***  400 Jun 16 08:57 .joe_state
out: -rw-r--r-- 1 *** ***  807 Apr  4  2018 .profile
out: drwx------ 2 *** *** 4096 Jun 15 09:49 .ssh
out: -rw-r--r-- 1 *** ***    0 Jun 15 10:11 .sudo_as_admin_successful
==============================================
✅ Successfully executed commands to all host.
==============================================

Any ideas?

Thanks Ian

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 6
  • Comments: 15 (2 by maintainers)

Commits related to this issue

Most upvoted comments

@manuel-cid I will take it. I will find out what’s different between scp-action and ssh-action.

Yeah! It’s worked!

I also had the same error. I was using cat ~/.ssh/key.pem to view the key on terminal. Then, i was copying the key and creating the secret. I was able see the output similar to

-----BEGIN RSA PRIVATE KEY-----
wvqgvreh rebrtykrb8k78kbbk5bn578bn5...
-----END RSA PRIVATE KEY-----%

The problem was with the % at the end. After removing the %, the error was gone.