Skip to content

SSH Keys

Generating an SSH key is required in order to properly develop and deploy our projects.

Generate a key

  1. Open your terminal
  2. Run the following command using your business email:
    ssh-keygen -t ed25519 -C "your@business-email.com"
    
  3. Press Enter to accept the default location and file name. If the .ssh directory doesn't exist, the system creates one for you.
  4. Enter, and re-enter, a passphrase when prompted.

Info

Always use ed25519. Do not use RSA or other older key types.

Key policies

  • Never reuse SSH keys across users or environments.
  • No shared SSH keys between developers — every person has their own key pair.
  • Private keys must never leave your device.
  • Public keys go in the target user's authorized_keys file.
  • SSH access to servers is restricted to Cloudflare Access identities. Direct public SSH is disabled.

Access to services

Once your key is generated, copy your public key and send it to @Patrick Tolvstein to get access to the services below.

Services requiring SSH access

  • Web server
    • Log files
    • Deployment
  • GitHub — for versioning and sharing code
  • Satis — packagist@barberklingen.dk

Copying the public key

pbcopy < ~/.ssh/id_ed25519.pub

Storing keys in CI/CD (Bitbucket Pipelines)

When an SSH private key must be stored as a CI/CD variable (e.g. in Bitbucket Pipelines):

  • Store the key exactly as generated — do not manually base64-encode it.
  • Preserve line breaks — a key with stripped newlines will not work.
  • If the CI system requires base64 encoding, encode the raw key and decode it back to its original form before use.

Warning

Incorrect encoding or missing line breaks will cause silent SSH authentication failures.