SamKirkland / web-deploy

Deploy your website automatically for free
MIT License
186 stars 30 forks source link

Permissions for web_deploy_key are too open #19

Open yarshad opened 10 months ago

yarshad commented 10 months ago

Bug Description I have stored the ss_key as a secret. When its copied to the file, I get the following error:

Permissions for 'D:\a\_actions\SamKirkland\web-deploy\v1\dist\.ssh\web_deploy_key' are too open.

My Action Config

  deploy:
    runs-on: windows-latest
    needs: build
    steps:
    - name: Install Rsync
      run: choco install rsync
    - name: Rsync version 
      run: gh version
    - name: webDeploy
      uses: SamKirkland/web-deploy@v1
      with:
        target-server: *******
        remote-user: **********
        private-ssh-key: ${{ secrets.SSH_KEY }}
        destination-path: ~/GitActionTest/

My Action Log

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
<Buffer 40 20 20 20 20 20 20 20 20 20 57 41 52 4e 49 4e 47 3a 20 55 4e 50 52 4f 54 45 43 54 45 44 20 50 52 49 56 41 54 45 20 4b 45 59 20 46 49 4c 45 21 20 20 ... 72 more bytes>
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
<Buffer 50 65 72 6d 69 73 73 69 6f 6e 73 20 66 6f 72 20 27 44 3a 5c 5c 61 5c 5c 5f 61 63 74 69 6f 6e 73 5c 5c 53 61 6d 4b 69 72 6b 6c 61 6e 64 5c 5c 77 65 62 ... 56 more bytes>
Permissions for 'D:\\a\\_actions\\SamKirkland\\web-deploy\\v1\\dist\\.ssh\\web_deploy_key' are too open.
<Buffer 49 74 20 69 73 20 72 65 71 75 69 72 65 64 20 74 68 61 74 20 79 6f 75 72 20 70 72 69 76 61 74 65 20 6b 65 79 20 66 69 6c 65 73 20 61 72 65 20 4e 4f 54 ... 24 more bytes>
It is required that your private key files are NOT accessible by others.
<Buffer 54 68 69 73 20 70 72 69 76 61 74 65 20 6b 65 79 20 77 69 6c 6c 20 62 65 20 69 67 6e 6f 72 65 64 2e 0d 0a>
This private key will be ignored.
<Buffer 4c 6f 61 64 20 6b 65 79 20 22 44 3a 5c 5c 61 5c 5c 5f 61 63 74 69 6f 6e 73 5c 5c 53 61 6d 4b 69 72 6b 6c 61 6e 64 5c 5c 77 65 62 2d 64 65 70 6c 6f 79 ... 52 more bytes>
Load key "D:\\a\\_actions\\SamKirkland\\web-deploy\\v1\\dist\\.ssh\\web_deploy_key": bad permissions
************************: Permission denied (publickey,keyboard-interactive).
<Buffer 72 73 79 6e 63 3a 20 5b 73 65 6e 64 65 72 5d 20 73 61 66 65 5f 72 65 61 64 20 66 61 69 6c 65 64 20 74 6f 20 72 65 61 64 20 [34](***************/job/18949547901#step:4:35) 20 62 79 74 65 73 3a 20 ... 31 more bytes>
rsync: [sender] safe_read failed to read 4 bytes: Connection reset by peer (104)
<Buffer 72 73 79 6e 63 20 65 72 72 6f 72 3a 20 65 72 72 6f 72 20 69 6e 20 72 73 79 6e 63 20 70 72 6f 74 6f 63 6f 6c 20 64 61 74 61 20 73 74 72 65 61 6d 20 28 ... [37](https://github.com/****************/actions/runs/6963609545/job/18949547901#step:4:38) more bytes>
rsync error: error in rsync protocol data stream (code 12) at io.c(282) [sender=3.2.7]
Error: Error: The process 'C:\ProgramData\Chocolatey\bin\rsync.exe' failed with exit code 12