This repository contains a Python script that automates the process of generating SSH keys for a list of users. It supports generating random passphrases for each key and allows specifying the key type.
- Generate SSH keys for multiple users.
- Supports RSA, DSA, ECDSA, and ED25519 key types.
- Optionally generate a random passphrase for each key.
- Store key information, including username, key name, passphrase, and public key fingerprint, in a user info file.
-
Prepare a list of users: Create a text file with one username per line.
-
Run the script: Execute the script with the path to your user list file as an argument.
python ssh_key_generator.py -t rsa -p user_list.txt
-t
or--key-type
: Specify the key type (default isrsa
).-p
or--passphrase
: Generate a random passphrase for each key.-e
or--excel
: Export output to an Excel file.user_list
: Path to the user list file.
./genpair -t ed25519 -p -e user_list.txt
This command will generate ED25519 keys with random passphrases for each
user listed in user_list.txt
and user_list.xlsx
.
The script will create SSH keys in the output
directory and store key information in a file named user_info
. The information includes the username, key name, passphrase (if generated), and public key fingerprint.
- Python 3.6 or higher
ssh-keygen
command available in the system's PATH
This project is licensed under the MIT License. See the LICENSE file for details.