SSHKeyDistribut0r has been written to make SSH key distribution easier for sysop teams.
pip install -r requirements.txt
First, copy the YAML files in the config directory and customize them.
cp keys.sample.yml keys.yml
cp servers.sample.yml servers.yml
The keys.yml file has to contain all users which are used in the
servers.yml file. Every entry in the YML structure requires the
following attributes:
The fullname
is a string value to mention the full name of a person.
keys
is a list of SSH keys in the format ssh-rsa <KEY> <comment>
.
The servers.yml file contains all servers with the specified user permissions. It consists of a list of dictionaries with the following attributes:
ip
: String value in the formatXXX.XXX.XXX.XXX
port
: Integer value which specifies the SSH portuser
: String value which specifies the system user to log in.comment
: String value to describe the systemauthorized_users
: List of strings which specify a user. Every user has to be declared in the keys.yml file as a key.
python key_distribut0r.py
To verify your configuration, you can run python key_distribut0r.py --dry-run
to see what would be changed whithout actually applying those changes.