A simple, automated tool for generating SSH keys from structured YAML input. Designed for anyone who wants to avoid manual key management.
- YAML-based configuration for multiple keys
- Automated key generation with proper permissions
- Option to backup or replace existing keys
- Field validation and error handling
- Summary output
- Python 3.x
- PyYAML (
pip install pyyaml) - OpenSSH (
ssh-keygenin your PATH)
python3 -m venv venv
source venv/bin/activate
pip install pyyaml pre-commit
pre-commit install- Set passphrase with
echo -n "passphrase" | base64and add it topass_b64inkeys.yml.
python3 -m venv venv
source venv/bin/activate
pip install pyyaml
python ssh_keygen.py keys.yml- Use
--dry-runto preview actions. - Use
--replaceto backup and overwrite existing keys. - Use
--key-dir ./to change directory to store keys (default: ~/.ssh) - If you run with both
--dry-runand--replaceit will act as backup, the script will still perform backups of existing keys before logging the dry-run action. So, even in dry-run mode, the backup step is executed, but no new keys are generated or overwritten - only the backup and logging happen.
- Integrate with Bitwarden somehow..