From 09451e717eb644bbbb43979cfcf49764403f5a75 Mon Sep 17 00:00:00 2001 From: minchodang Date: Fri, 17 May 2024 23:15:07 +0900 Subject: [PATCH] =?UTF-8?q?Fix:=20ssh=20key=20pem=20debug=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy-main.yml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/deploy-main.yml b/.github/workflows/deploy-main.yml index 15ba412..6c28f70 100644 --- a/.github/workflows/deploy-main.yml +++ b/.github/workflows/deploy-main.yml @@ -17,18 +17,19 @@ jobs: run: | echo "$SSH_KEY" > key.pem chmod 600 key.pem - echo "SSH key file created and permissions set." - ls -la key.pem # 키 파일이 제대로 생성되었는지 확인 - cat key.pem # 키 파일 내용 확인 (보안 상 민감하므로 실제로는 출력하지 않음) - + # Debugging: Verify the key file is correctly created and permissions are set + echo "SSH key file content:" + cat key.pem + echo "SSH key file permissions:" + ls -l key.pem + - name: Connect and run script on remote host run: | - ssh -i key.pem -o StrictHostKeyChecking=no ${USER}@${HOST} "bash git-action.sh" + ssh -v -i key.pem -o StrictHostKeyChecking=no ${USER}@${HOST} "bash git-action.sh" env: USER: ${{ secrets.USER }} HOST: ${{ secrets.HOST }} SSH_KEY: ${{ secrets.SSH_KEY }} - # 추가된 환경 변수들 AWS_DEFAULT_REGION: ap-northeast-2 AWS_REGION: ap-northeast-2 AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} @@ -48,9 +49,6 @@ jobs: GOOGLE_CALLBACK_URL: ${{ secrets.GOOGLE_CALLBACK_URL }} GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }} - - - - name: Remove Github Actions IP From Security Group run: | aws ec2 revoke-security-group-ingress --group-id ${{ secrets.AWS_SG_ID }} --protocol tcp --port 22 --cidr ${{ steps.ip.outputs.ipv4 }}/32