easingthemes / ssh-deploy

GitHub Action for deploying code via rsync over ssh. (with NodeJS)
MIT License
1.17k stars 144 forks source link

Wired permission denied,when connect to host could help me analysis where i am wrong #170

Closed joebnb closed 11 months ago

joebnb commented 11 months ago

in use ssh-deploy as readme recommend and write a test deploy script,i was tryed all ways that i can considered.but it did not work, if have spare time.

this is clue of my test. image

in this image is:

i doubt the private key did work well,so i copy key in to a ubuntu container(runner also running under a contaienr),then trying same command to connect target host. image

image

the key configuration is works for test container and this is the permission of test file and ownership,in this working case cat ls was readout the file content

image

the deploy script is

          - name: Echo user
            run: echo ${{ vars.REMOTE_USER }} && ping -c 2 -W 3 ${{ vars.REMOTE_HOST }}
          - name: Deploy
            uses: easingthemes/ssh-deploy@main
            with:
              SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
              ARGS: "-rlgoDzvc -i --delete"
              REMOTE_HOST: ${{ vars.REMOTE_HOST }}
              REMOTE_USER: ${{ vars.REMOTE_USER }}
              TARGET: ${{ vars.REMOTE_TARGET }}
              SOURCE: "src/"
              EXCLUDE: "/dist/, /node_modules/"
              SCRIPT_BEFORE: |
                  whoami
                  ls -al
              # SCRIPT_AFTER: |
              #     whoami
              #     ls -al
              #     echo "done!"
          - name: look perm
            run: whoami && ls -la /home/runner/.ssh  && cat $(ls /home/runner/.ssh)

where i am wrong.