ssh-action icon indicating copy to clipboard operation
ssh-action copied to clipboard

Suddenly getting "Error: can't connect without a private SSH key or password"

Open eli-s-r opened this issue 3 years ago • 4 comments

Hi, I've been using this fantastic tool for several months now and haven't encountered any issues until this point. However, despite there not being any changes to my script or to my configuration, I'm suddenly receiving Error: can't connect without a private SSH key or password. I am indeed using a private key -- below is my configuration for the action:

- name: SSH into droplet
  uses: appleboy/ssh-action@master
  with:
    host: ${{ secrets.DROPLET_HOST }}
    username: ${{ secrets.DROPLET_USERNAME }}
    passphrase: ${{ secrets.DROPLET_PASSWORD }}
    key: ${{ secrets.DROPLET_PRIVATE_KEY }}
    envs: COMMIT_SHA
    script_stop: true
    script: |
      git fetch origin
      git merge $COMMIT_SHA

What could have changed that may be causing this issue?

eli-s-r avatar Mar 10 '21 00:03 eli-s-r

Ah, think I found the problem! Turns out the action was only failing when triggered by a Dependabot PR, and as of the beginning of this month, workflows triggered by Dependabot PRs run with read-only permissions and aren't able to access Secrets. Am now looking into how to get around this issue

eli-s-r avatar Mar 13 '21 04:03 eli-s-r

I am having the same issue. Is there any workaround or solution?

sametmasaci avatar May 03 '21 12:05 sametmasaci

I am having the same issue. Is there any workaround or solution?

@sam541 Not sure if this is a possibility for you, but I think I resolved this for myself by enabling pull request workflows on forks? (on the Actions tab in the repo settings) image

eli-s-r avatar May 03 '21 15:05 eli-s-r

@eli-s-r I didn't try as I do not have any branches on my project currently. Thanks I will try when I need to make any pull request

sametmasaci avatar May 11 '21 07:05 sametmasaci

Please try the latest version. Please open it again (for the author) or create a new one and reference this (for others) if you have the same problem.

appleboy avatar Apr 13 '23 08:04 appleboy

I am having the same issue. Is there any workaround or solution?

use appleboy/[email protected] instead of appleboy/ssh-action@master

kzamanbd avatar Apr 18 '23 05:04 kzamanbd

@kzamaan cool thanks, at current time version was changed, need using appleboy/[email protected]

m0zgen avatar Apr 26 '23 07:04 m0zgen

0.1.4 worked for me, but I think this is the permanent solution: https://github.com/appleboy/scp-action/issues/113

erick-go avatar Jun 04 '23 05:06 erick-go