gh-sks

GitHub SSH Key Sync for Linux Servers

Latest version

Automatically sync GitHub users' public SSH keys into your server's ~/.ssh/authorized_keys. Runs automatically hourly.

$curl -fsSL https://github.com/BenDutton/gh-sks/releases/latest/download/install.sh | sudo bash

Commands

Add Mapping

Grant a GitHub user SSH access to a Linux account.

sudo gh-sks --add <linux_user> <github_user>
Remove Mapping

Revoke a GitHub user's SSH access. Run a sync afterwards to apply.

sudo gh-sks --remove <linux_user> <github_user>
List Mappings

Show all configured Linux ↔ GitHub user mappings.

gh-sks --list
Sync Keys

Run an immediate sync. Also runs automatically every hour via systemd timer.

sudo gh-sks
Update

Download and install the latest release. Config and timer are preserved.

sudo gh-sks --update
Uninstall

Remove gh-sks, its systemd timer, config, and all managed key blocks.

sudo gh-sks --uninstall