SSH Key Manager is a bash script designed to simplify the process of generating, importing, and managing SSH keys across multiple hosts. It provides an interactive interface for common SSH key operations and includes security checks to ensure best practices are followed.
- Generate new SSH key pairs
- Import existing private keys
- Configure remote hosts with existing keys
- Perform local SSH security checks
- Interactive menu-driven interface
- Colorized output for better readability
- Hardware Key Support
- Password-Protected Keys
- possibly Implementation in Python (with more Features) and publishing in AUR
- Bash shell (version 4.0 or later recommended)
- OpenSSH client tools (ssh, ssh-keygen, ssh-copy-id)
- sudo privileges for some operations
- Clone this repository or download the
sshkeymanager.sh
script. - Make the script executable:
chmod +x sshkeymanager.sh
Run the script with:
./sshkeymanager.sh
Follow the on-screen prompts to perform various SSH key management tasks.
- Generate new SSH key pair: Creates a new SSH key pair and configures it for use with a remote host.
- Import existing key for remote host: Imports an existing private key and configures it for use with a remote host.
- Configure remote host with existing keys: Copies an existing public key to one or more remote hosts.
- Check local SSH security settings: Performs a series of checks on your local SSH configuration and offers to fix any issues found.
- The script may require sudo privileges for some operations. Review the code to understand what elevated actions it performs.
This script is primarily designed for Linux systems using systemd. It has been tested on various distributions, including Ubuntu and Arch Linux. While it should work on most POSIX-compliant shells, it's primarily intended for use with bash.
You can modify the following variables at the beginning of the script to customize its behavior:
sshd_config
: Location of the SSH daemon configuration filessh_keys_location
: Directory where SSH keys are stored
Contributions to improve SSH Key Manager are welcome. Please feel free to submit issues or pull requests through the project's Git repository.
This project is licensed under the MIT License. See the LICENSE file for details.
This script is provided as-is, without any warranty. Always review and understand any script that modifies system configurations before running it, especially with elevated privileges.