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

ProxyCommand Cloudflare example #133

Open
RuslanZavacky opened this issue Sep 6, 2021 · 1 comment
Open

ProxyCommand Cloudflare example #133

RuslanZavacky opened this issue Sep 6, 2021 · 1 comment

Comments

@RuslanZavacky
Copy link

I see that ProxyCommand is available, but can't figure out how to correct specify it like to connect via Cloudflared agent. For example, in Cloudflare, .ssh/config looks like this:

Host jump.something.dev
  ProxyCommand /usr/local/bin/cloudflared access ssh --hostname %h --id <myid> --secret <mysecret>
  ServerAliveInterval 30
  ServerAliveCountMax 5

How I can specify that in yaml?

Thank you in advance!

@metrue
Copy link

metrue commented Jan 2, 2023

I was looking for it, end up with following solution.

name: api-deployment

on:
  push:
    branches:
      - master

jobs:
  deployment:
    runs-on: ubuntu-latest
    steps:
      - name: check out
        uses: actions/checkout@master
      - name: install cloudflared
        run: |
          curl -L https://pkg.cloudflare.com/cloudflare-main.gpg | sudo tee /usr/share/keyrings/cloudflare-archive-keyring.gpg >/dev/null
          echo "deb [signed-by=/usr/share/keyrings/cloudflare-archive-keyring.gpg] https://pkg.cloudflare.com/cloudflared $(lsb_release -cs) main" | sudo tee  /etc/apt/sources.list.d/cloudflared.list
          sudo apt update
          sudo apt-get install cloudflared
          cloudflared --version
      - name: install-ssh-key
        uses: shimataro/ssh-key-action@v2
        with:
          key: ${{ secrets.SSH_PRIVATE_KEY }}
          name: id_rsa
          known_hosts: ${{ secrets.KNOWN_HOSTS }}
          if_key_exists: fail
      - name: deploy api
        run:
          ssh  -o ProxyCommand="cloudflared access ssh --hostname <host>" pi@<host> < ./scripts/deploy_api.sh

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