Skip to content

Instantly share code, notes, and snippets.

@arno01
Created March 2, 2022 21:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arno01/a087307cd2523cf366a5c1f02c616190 to your computer and use it in GitHub Desktop.
Save arno01/a087307cd2523cf366a5c1f02c616190 to your computer and use it in GitHub Desktop.
---
version: "2.0"

services:
  sshd:
    image: ubuntu:21.10
    env:
      - 'SSH_PUBKEY=ssh-rsa AAAAB3...YOUR_PUBLIC_SSH_KEY ogp8='
    command:
      - "sh"
      - "-c"
    args:
      - 'apt-get update;
      apt-get install -y --no-install-recommends -- ssh;
      mkdir -p -m0755 /run/sshd;
      mkdir -m700 ~/.ssh;
      echo "$SSH_PUBKEY" | tee ~/.ssh/authorized_keys;
      chmod 0600 ~/.ssh/authorized_keys;
      ls -lad ~ ~/.ssh ~/.ssh/authorized_keys;
      md5sum ~/.ssh/authorized_keys;
      exec /usr/sbin/sshd -D'
    expose:
      # SSH
      - port: 22
        as: 22
        to:
          - global: true

profiles:
  compute:
    sshd:
      resources:
        cpu:
          units: 1.0
        memory:
          size: 1Gi
        storage:
          size: 1Gi
  placement:
    akash:
      attributes:
        host: akash
      signedBy:
        anyOf:
          - "akash1365yvmc4s7awdyj3n2sav7xfx76adc6dnmlx63"
      pricing:
        sshd:
          denom: uakt
          amount: 1000

deployment:
  sshd:
    akash:
      profile: sshd
      count: 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment