ghkeys

command module
v0.0.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2016 License: MIT Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

ghkeys Build Status Coverage Status

ghkeys is a simple command line tool for syncing server users' authorized SSH keys with those of one or more GitHub accounts.

Via configuration, specify individual GitHub users and/or entire teams, whose SSH keys should either be output directly or written to server users' authorized_keys files.

Installation

go get github.com/conortm/ghkeys

Configuration

Create a config.yml file like config.example.yml:

---
# Replace with your own personal access token:
github_token: my_github_token
# Array of server usernames and the GitHub source(s) of their authorized keys:
users:
  - username: superadmin
    github_users:
      - github_user_1
    github_teams:
      # Specify teams by Org name and team name, separated by a /
      - MyOrg/Team 1
      - MyOrg/Team 2
  - username: admin
    github_users:
      - github_user_1
      - github_user_2
    github_teams:
      - MyOtherOrg/Team 3

Note: Replace my_github_token with your own personal access token.

Usage

To print all keys:

ghkeys -config=/path/to/config.yml

Pass single username argument to print only that user's keys, for example, when using AuthorizedKeysCommand:

ghkeys -config=/path/to/config.yml superadmin

Use the -write flag to write keys to users' authorized_keys files:

ghkeys -config=/path/to/config.yml -write

TODO

License

MIT © Conor McNamara

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL