https://github.com/davidetriso/github-deploy-key-generator
Simplify the management of GitHub deploy keys on linux servers
https://github.com/davidetriso/github-deploy-key-generator
deployment github linux ssh-key
Last synced: 2 months ago
JSON representation
Simplify the management of GitHub deploy keys on linux servers
- Host: GitHub
- URL: https://github.com/davidetriso/github-deploy-key-generator
- Owner: DavideTriso
- License: mit
- Created: 2023-02-08T19:26:30.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-06-28T09:13:59.000Z (almost 2 years ago)
- Last Synced: 2025-05-29T13:14:57.553Z (10 months ago)
- Topics: deployment, github, linux, ssh-key
- Language: Shell
- Homepage:
- Size: 12.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GitHub Deploy Key Generator
Scripts to simplify the management of GitHub deploy keys on linux servers
## Generate a GitHub deploy key
To generate a deploy key execute the `generate-deploy-key` script
The script
* generates a new ssh key with the provided name and email;
* appends the required host configuration to the SSH config file (the file will be created if it doesn't exist);
* prints the generated public key for you to copy and paste it in GitHub;
The script accepts three required arguments:
* `repository_name`: the name of the repository you are generating the key for (e.g. `github-deploy-key-generator`)
* `email_address`: is passed as comment (`-C`) to the `ssh-keygen` command
* `dir`: absolute path to the root directory where the keys must be installed (e.g. `/root/.ssh`)
E.g.:
```bash
./generate-deploy-key.sh github-deploy-key-generator davidetrisolini@yahoo.it "/root/.ssh/"
```
## Revoke a GitHub deploy key
To revoke a deploy key execute the `revoke-deploy-key` script.
The script
* deletes the public and private key files;
* removes the host configuration from the SSH config file
The scripts accepts two required parameters:
* `repository_name`: the name of the repository owning the key you want to revoke (e.g. `github-deploy-key-generator`)
* `dir`: absolute path to the root directory where the keys are installed (e.g. `/root/.ssh`)
E.g.:
```bash
./revoke-deploy-key.sh github-deploy-key-generator "/root/.ssh/"
```