Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error "can't connect without a private SSH key or password" #113

Closed
saberkovich opened this issue Apr 15, 2023 · 11 comments
Closed

Error "can't connect without a private SSH key or password" #113

saberkovich opened this issue Apr 15, 2023 · 11 comments

Comments

@saberkovich
Copy link

I ran into the error I described in the title, tried to reinstall the server but nothing helps. Surprisingly, yesterday everything was working fine, today the error is already popping up.

My file:

name: Deploy

on: [push]

jobs:
  build:

    runs-on: ubuntu-latest
    environment: main

    steps:
    - uses: actions/checkout@v1

    - name: Copy repository contents via scp
      uses: appleboy/scp-action@master
      env:
        HOST: ${{ secrets.HOST }}
        USERNAME: ${{ secrets.USERNAME }}
        PORT: ${{ secrets.PORT }}
        KEY: ${{ secrets.SSHKEY }}
      with:
        source: "."
        target: "/servers_folder/bfg-bot/"

    - name: Executing remote command
      uses: appleboy/ssh-action@master
      with:
        HOST: ${{ secrets.HOST }}
        USERNAME: ${{ secrets.USERNAME }}
        PORT: ${{ secrets.PORT }}
        KEY: ${{ secrets.SSHKEY }}
        script: reboot

Error:

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

@saberkovich
Copy link
Author

I know that already wrote on this error, it was specified that you need to add:
environment: main
That didn't work.

@kherchel
Copy link

Switch from using scp-action@master to v0.1.4, this fixed the issue for me

@dongeerts
Copy link

dongeerts commented Apr 15, 2023

I have the same issue as described when using the @master version. Using @v0.1.4 as @kherchel mentioned fixes the issue for now.

@saberkovich
Copy link
Author

Now I see another error:

ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain

@saberkovich
Copy link
Author

Switch from using scp-action@master to v0.1.4, this fixed the issue for me

This solution worked.

Note: Set version v0.1.4 only in file transfer settings, no need in Executing remote command.

@appleboy
Copy link
Owner

@saberkovich Please update your config. Don't use environment variable.

Find

    - name: Copy repository contents via scp
      uses: appleboy/scp-action@master
      env:
        HOST: ${{ secrets.HOST }}
        USERNAME: ${{ secrets.USERNAME }}
        PORT: ${{ secrets.PORT }}
        KEY: ${{ secrets.SSHKEY }}
      with:
        source: "."
        target: "/servers_folder/bfg-bot/"

Replace

    - name: Copy repository contents via scp
      uses: appleboy/scp-action@master
      with:
        host: ${{ secrets.HOST }}
        username: ${{ secrets.USERNAME }}
        port: ${{ secrets.PORT }}
        key: ${{ secrets.SSHKEY }}
        source: "."
        target: "/servers_folder/bfg-bot/"

@tarikmanoar
Copy link

@appleboy Thanks a lot problem solved

@dongeerts
Copy link

Thanks @appleboy, that did the trick.

MorganTwoZero added a commit to MorganTwoZero/pic-scraper-backend that referenced this issue Apr 16, 2023
@damianmr
Copy link

damianmr commented Apr 17, 2023

@saberkovich Please update your config. Don't use environment variable.

Find

    - name: Copy repository contents via scp
      uses: appleboy/scp-action@master
      env:
        HOST: ${{ secrets.HOST }}
        USERNAME: ${{ secrets.USERNAME }}
        PORT: ${{ secrets.PORT }}
        KEY: ${{ secrets.SSHKEY }}
      with:
        source: "."
        target: "/servers_folder/bfg-bot/"

Replace

    - name: Copy repository contents via scp
      uses: appleboy/scp-action@master
      with:
        host: ${{ secrets.HOST }}
        username: ${{ secrets.USERNAME }}
        port: ${{ secrets.PORT }}
        key: ${{ secrets.SSHKEY }}
        source: "."
        target: "/servers_folder/bfg-bot/"

Thank you for the support @appleboy , we had this issue as well. Just asking out of curiosity, were there any internal changes in the current release (v0.1.9) that could have affected this behavior? It was working for us until a couple of days ago.

@afg-saurabhnikam
Copy link

Error: docker: command not found

Getting this error when using above code.

@JeffreyMa597
Copy link

JeffreyMa597 commented Aug 6, 2023

I fixed it by removing the PORT.

jwoolley added a commit to jwoolley/mirror-gallery that referenced this issue Jan 5, 2024
jakob-hendrix added a commit to jakob-hendrix/pathfinder-gen that referenced this issue May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants