Skip to content
Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


This simple little utility allows you to manage the authorized_keys files for a number of servers & users. It is designed to provide easy access to ensure that you can revoke & grant access to appropriate people on multiple servers.


To install, just install the Rubygem.

$ gem install keyman

Once installed, you will need to create yourself a manifest directory. This directory will contain all your configuration for your key manager. You can easily do this using the init command:

$ keyman init path/to/manifest

This will create a directory containing two files, a and a These files contain examples and comments which should help you get started.

Example Users/Groups Manifest File

The below file is an example of a manifest file.

group :admins do
  user :adam, 'ssh-rsa AAAAB3NzaC1yc2EAAAA[...]=='
  user :charlie, 'ssh-rsa AAAAB3NzaC1yc2EAAAA[...]=='
  user :nathan, 'ssh-rsa AAAAB3NzaC1yc2EAAAA[...]=='

group :staff do
  user :jack, 'ssh-rsa AAAAB3NzaC1yc2EAAAA[...]=='
  user :dan, 'ssh-rsa AAAAB3NzaC1yc2EAAAA[...]=='

Example Server Manifest File

The below file is an example of a file.

# An example configuration for a server where all admin users have
# access as 'root' and all staff users have access as 'app'.
server do
  host ''
  user 'root', :admins
  user 'app', :admins, :staff

# An example configuration for a server where admins plus one other user
# have access as root only.
server do
  host ''
  user 'root', :admins, :dan

# An example of a group of servers each with the same permissions. These 
# will create servers with the same 
server_group :load_balancers do
  host ''
  host ''
  host ''
  user 'root', :admins
  user 'app', :admins, :staff

You may add as many .km files as you wish to to your manifest directory and they will be loaded. However, all users should be defined in and nowhere else.

Pushing files to servers

In order to push your authorized_keys files to your servers, keyman must be able to authenticate. In the first instance, we will attempt to use your local SSH keys to do this. If we cannot authenticate with these, you will be prompted for the password when you attempt to push. This password, if accepted, will then be cached for your "session" and attempted for any subsequent servers which cannot be authenticated with your SSH keys.

$ cd path/to/manifest
# to push configuration to all servers
$ keyman push
# to push configuration to a specific server
$ keyman push
# to push configuration to a server group
$ keyman push load_balancers

There are other commands available within the app, you can view these by viewing the inline help.

$ keyman help

Storing your manifest directory

It is recommended to store your manifest directory in a Git repository. Once in a repository, you will be required to ensure that your local branch is always the same as your remote branch before you can push to a server. This ensures that you cannot overwrite someone elses changes should you forget to pull before pushing.

This behaviour is automatic and currently non-optional when there is a .git directory in your manifest.


A utility for managing distributed authorized keys






No releases published


No packages published