https://github.com/taskbjorn/ssh-keypack
https://github.com/taskbjorn/ssh-keypack
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/taskbjorn/ssh-keypack
- Owner: taskbjorn
- License: gpl-3.0
- Created: 2024-04-19T13:53:47.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-11T10:15:10.000Z (over 1 year ago)
- Last Synced: 2025-01-23T10:16:55.500Z (over 1 year ago)
- Language: Shell
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SSH keypack
## Overview
Effortlessly generate SSH keys with a streamlined BASH script. This script
creates neatly organized archives with standardized file names, public/private
key pairs, and a matching checksum—perfect for secure and hassle-free storage.
> [!NOTE]
> **Why not use a Python script?**
>
> Of course SSH keypack could be much fancier, safer and modern as a Python
> script. But I wanted it to be extremely simple to deploy and use on any of my
> systems with minimal dependencies. It is just a hacky script for personal use!
## Dependencies
This script requires OpenSSH. For Debian-based distributions, you can install
OpenSSH with:
```ssh
sudo apt install --yes openssh-client
```
Create a symlink to your current user local binary folder to call `ssh-keypack`
from shell.
```shell
chmod +x ssh-keypack.sh
ln -s ssh-keygen ~/.local/bin/ssh-keypack
```
## Usage
To generate a key pack, run the script with the required command line arguments:
```shell
ssh-keypack
```
All available positional command line arguments are listed below and can be
review from the command line via the `ssh-keypack --help` command:
| Positional argument | Required | Description |
| --- | :-: | --- |
| `algorithm` | Yes | Algorithm string passed to ssh-keygen. |
| `user` | Yes | Username associated with this SSH key pair. |
| `host` | Yes | Hostname associated with this SSH key pair. |
| `git-username` | No | Owner of the Git repository associated with this SSH key pair. |
| `git-repository` | No | Name of the Git repository associated with this SSH key pair. |
## Naming scheme
The fields marked with `` are meant for SSH keys to access specific
repositories and may be omitted.
* Comment schema for generic SSH key:
`-key--@`
* Comment schema for Git repository SSH key:
`-key--@:+`
Filenames follow a scheme analogous to the SSH keys comment, but in the case of
Git repository paths replace the character `/` with `+` to comply with
filesystem naming restrictions.
The following extensions are used:
* `.ospubk`: public key in OpenSSH format
* `.ospk`: private key in OpenSSH format
* `.sha256`: SHA256 checkum of the private key
## Safety
Use `ssh-keypack` with care: it is a simple BASH script with no input validation
or safety checks of any kind.