Files
apps/sync-github-sshkeys/Readme.md
2025-09-11 00:37:18 +05:30

31 lines
967 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Sync GitHub Team SSH Keys to Root
This tool automatically syncs the SSH public keys of all members of a GitHub team into the `root` users `~/.ssh/authorized_keys`.
It is useful for managing server access in organizations where team membership on GitHub defines who should have SSH access.
---
## Features
- Syncs SSH keys from a GitHub team into `root`s authorized keys
- Backs up old keys automatically
- Installs as a cronjob (runs hourly by default)
- Interactive setup: select your organization and team from GitHub
- Stores your GitHub token securely in `/root/.github-token`
---
## Requirements
- Linux server with root access
- `curl` and `jq` installed
- GitHub [Personal Access Token (PAT)](https://github.com/settings/tokens) with **`read:org`** scope
---
## Quick Install
Run this as root:
```bash
curl -s https://raw.githubusercontent.com/excloud-in/examples/main/sync-github-sshkeys/sync-github-sshkeys.sh | bash
```