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

ssh: handshake failed: read tcp *****:*** ->*****:***: read: connection reset by peer #292

Open
joris-Bourguet opened this issue Jan 30, 2024 · 2 comments

Comments

@joris-Bourguet
Copy link

Hello, I'm trying to deploy my test app on server with githubactions but im encountering this error ssh: handshake failed: read tcp : ->:: read: connection reset by peer

The ssh key is in my server authorized keys and on my github https://github.com/settings/keys

The error happen in the deployment job, steps : Deploy using SSH

name: BUILD AND DEPLOY Laravel application

on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]

permissions:
  contents: read

jobs:
  build:
    name: Build project
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
    - name: Validate composer.json and composer.lock
      run: composer validate --strict
    - name: Cache Composer packages
      id: composer-cache
      uses: actions/cache@v3
      with:
        path: vendor
        key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
        restore-keys: |
          ${{ runner.os }}-php-
    - name: Install dependencies
      run: composer install --prefer-dist --no-progress

  deployment:
    name: Deploy project
    environment: production
    needs: build
    runs-on: ubuntu-latest
    steps:
      - name:  Checkout Repository
        uses: actions/checkout@v3

      - name: Deploy using SSH
        uses: appleboy/[email protected]
        with:
          host: ${{ secrets.HOST }}
          username: ${{ secrets.REMOTE_USER }}
          key: ${{ secrets.SSH_PRIVATE_KEY }}
          port: ${{ secrets.PORT }}
          script: |
            cd ~/www/dev
            git pull origin main
            git status
            npm install --only=prod
          debug: true
@joris-Bourguet
Copy link
Author

Update : My credentials are fine but my server firewall was blocking ssh entry, I allowed them and now it works

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

2 participants
@joris-Bourguet and others