x4121 / SSHKeyDistribut0r

A tool to automate key distribution with user authorization

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CC BY

SSHKeyDistribut0r has been written to make SSH key distribution easier for sysop teams.

Screenshot

How to use

Install dependencies

pip install -r requirements.txt

Create configuration files

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 format XXX.XXX.XXX.XXX
  • port: Integer value which specifies the SSH port
  • user: String value which specifies the system user to log in.
  • comment: String value to describe the system
  • authorized_users: List of strings which specify a user. Every user has to be declared in the keys.yml file as a key.

Execute SSHKeyDistribut0r

python key_distribut0r.py

Dry run

To verify your configuration, you can run python key_distribut0r.py --dry-run to see what would be changed whithout actually applying those changes.

About

A tool to automate key distribution with user authorization

License:Other


Languages

Language:Python 100.0%