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

Can't get it to work – Permission denied #198

Open
geoidesic opened this issue Dec 26, 2023 · 1 comment
Open

Can't get it to work – Permission denied #198

geoidesic opened this issue Dec 26, 2023 · 1 comment

Comments

@geoidesic
Copy link

geoidesic commented Dec 26, 2023

I had a go with this and it although I've put the private key into a secret and done:

name: Deploy to VPS

on:
  push:
    branches:
      - main

jobs:
  deploy:
    runs-on: ubuntu-latest

    steps:
    - name: Set up SSH
      uses: webfactory/ssh-agent@v0.8.0
      with:
        ssh-private-key: ${{ secrets.VPS_SSH_PVT_KEY }}
    
    - name: Manually update known_hosts
      run: |
        mkdir -p ~/.ssh/ && touch ~/.ssh/known_hosts &&
        ssh-keyscan <ip_address> >> ~/.ssh/known_hosts

    - name: Deploy to VPS
      run: ssh -v cicd@<ip_address> "cd /var/www/html/edge-hello-world && git pull origin main"

It doesn't seem to find the key:

debug1: Offering public key: --REDACTED-- agent
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic
debug1: Trying private key: /home/runner/.ssh/id_rsa
debug1: Trying private key: /home/runner/.ssh/id_ecdsa
debug1: Trying private key: /home/runner/.ssh/id_ecdsa_sk
debug1: Trying private key: /home/runner/.ssh/id_ed25519
debug1: Trying private key: /home/runner/.ssh/id_ed25519_sk
debug1: Trying private key: /home/runner/.ssh/id_xmss
debug1: Trying private key: /home/runner/.ssh/id_dsa
debug1: No more authentication methods to try.
cicd@<redacted-ip-address> Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
Error: Process completed with exit code 255.
@geoidesic geoidesic changed the title Doesn't seem to put keys into /home/runner/.ssh Can't get it to work – Permission denied Dec 26, 2023
@OMKE
Copy link

OMKE commented Feb 29, 2024

Did you manage to fix the issue, I have the same problem.

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