Hecate simlifies the task of distributing ssh public keys in a network. Hecate uses Consul as a persistent store for a user's public keys and removes the need for users to push their public keys around the network. From a user perspective, the process is simple:
- Run
hecate provisionto generate a SSH private/public key pair. The public key is uploaded to Consul. The private key never leaves the host. - Wait. Remote hosts running the Hecate daemon will periodically connect to Consul and generate a
~/.ssh/authorized_keysfile for each user that: - Has an account on the remote host AND
- Has keys distributed via Hecate
- SSH to the remote host... no password needed!
sudo apt-get install python-pip
sudo apt-get install python-dev
pinky:ssh-hecate ncfritz$ pwd
/home/ncfritz/ssh-hecate
pinky:ssh-hecate ncfritz$ sudo ./install.sh
pinky:ssh-hecate ncfritz$ sudo hecate config -e --global
Consul host [IP]: 192.168.0.10
Consul port: 8500
Token:
Data Center:
Verify SSL [y/N]: n
pinky:ssh-hecate ncfritz$ hecate provision
Generating SSH key pair...
Public key uploaded successfully... user ncfritz is now provisioned for host vmhost-02
Please allow approximately 3 hours for public key propagation
pinky:ssh-hecate ncfritz$ sudo supervisord -c /usr/local/hecate/etc/supervisord.config
Hecate contains several sub-commands
provision- seeds a public key to Consul, creating a private/public key pair is necessarylist- lists users in Consul, or the keys for a specific userget- retrieves the public key for a user/host combinationdelete- deletes a user from Consul, or a specific key for a usersync- synchronizes theauthorized_keysfor all, or a specific user/sconfig- displays or edits the Consul configurationdaemon- runs the Hecate daemon
You can run the daemon in the foreground usinghecate daemon for debugging or testing purposes. It is recommended that you run the synchronizing daemon as a managed, long lived process using Supervisord. Hecate ships with a sample Supervisord config file in etc/supervisord.config. To run Supervisord locally use the following command:
sudo supervisord -c /usr/local/hecate/etc/supervisord.config
Note that you need to run as root. Since Hecate will be creating/modifying the .ssh/authorized_keys files for all users it need to run as a priviledged user. You may also wish to run Supervisord on startup.