An SSH key syncing utility
Table of Contents
Warning this project unmaintained and definitely over engineered, there are easier ways to fetch keys"
keysync is a command line utility and service to help keep your local authorized_keys file synced to a master copy of public keys.
The program allows syncing from Github, GitLab, Launchpad at the moment, custom url support is coming soon. It downloads and filters only keys that you don't already have a local copy of. This application can be used for either as one time sync when run, or running automatically in the background as a systemd service. You can have the file it updated at a preset interval or a custom cron expression, you can even support multiple users and providers.
Note: Automatic jobs will fail if the computer goes to sleep/hibernate. The systemd daemon is recommended primarily for servers. For personal computers it is recommended to just run the command manually whenever you add public keys.
Warning If you're Github, GitLab or Launchpad is compromised an attacker can upload their keys to gain access to you're computer. For security please do not set this program up for a root user, you're just asking for trouble.
If you have rust installed you can use cargo.
requires a the following packages to be install:
libsqlite-dev, build-essential, libssl-dev (Debian names)
cargo install nxcloud
Other packaged binary's are available in Releases.
The binary name is keysync
To display application use keysync help
Use keysync <subcommand> help
for help with that subcommand.
Downloads the public keys from github for the username.
keysync get <username>
Downloads the public keys from GitLab for the username, a url must be provided or '' for https://gitlab.com
.
keysync get --gitlab <url> <username>
Adds automatic job for the user, where username is the Github or GitLab username.
Valid schedules are [Hourly, Daily, Weekly, Monthly, Custom].
keysync set <username> <schedule>
Adds automattic job for user with custom cron schedule.
keysync set <username> custom -c <cron>
This repository is a standard rust project bin structure.
- Install Rust
- Install build-essential, libssl-dev, libsqlite3-dev (Linux)
apt install build-essential libssl-dev libsqlite3-dev
(Debian based) - Clone repository
Rust support building or running with the following commands:
cargo build
Will build an executable in /target/debug/
.
cargo run -- <args>
Will build and run an executable.
Testing all standard test can be done with rust built in test framework.
cargo test
Some tests cannot be completed with 100% reliability (for example they might fail without network access), this will run all ignored tests.
cargo test -- --ignored
Rust built in documentation tools can be generated.
cargo doc
To open with your default browser.
cargo doc --open
Contributions are completely welcome and encouraged!
Examples of contributing could include:
- Submitting a feature request or bug report.
- Asking for improved documentation.
- Code by creating a pull request.
Refer to Contributing
Development is still in progress with new features being planned.
Feel free to Contribute.
Created by Ethan Budd
Email: budde25@protonmail.com
Dual-licensed under either either of the following: