fifsky / ssh-action

🖥 github ssh action

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Permission denied (publickey,gssapi-keyex,gssapi-with-mic)

luutruong opened this issue · comments

YML setup:

name: Deploy

on:
  push:
    branches:
      - master

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2

      - name: Executing remote command
        uses: fifsky/ssh-action@master
        with:
          host: ${{ secrets.HOST }}
          user: ${{ secrets.USERNAME }}
          key: ${{ secrets.SSH_KEY }}
          port: ${{ secrets.PORT }}
          args: "-tt -vvv"
          command: "cd ${{ secrets.DEPLOY_PATH }} && bash scripts/ci-deploy.sh"

Check your server sshd configuration

vi /etc/ssh/sshd_config

PubkeyAuthentication yes

I did set that config but still have issue.

https://phoenixnap.com/kb/ssh-permission-denied-publickey
https://stackoverflow.com/questions/36300446/ssh-permission-denied-publickey-gssapi-with-mic

Maybe it can help you

Special attention should be paid to the SSH config file and key file permissions, Setting 700 to .ssh and 600 to authorized_keys solved the issue.

@fifsky I have tried all above methods before create this issue. Btw i created ssh key in local and push it to server and work fine but when using key from server it's does not.