SSH Key Manager — create, organize, grant, and revoke SSH keys. Pure Bash + OpenSSH.
Explore the docs · Report Bug · Request Feature
Table of Contents
- One identity per purpose — each SSH key lives in its own namespace under
~/.ssh/keys/ - Manage outgoing identities —
create,list,show,copy,deletewith one command per action - Manage incoming access —
grantandrevokewho can connect to your machines - Zero dependencies — pure Bash, only needs OpenSSH (standard on macOS and Linux)
- All key types supported — ed25519 (recommended), RSA 4096, and any type OpenSSH supports
curl -fsSL https://raw.githubusercontent.com/Sofian-bll/sshk/main/install.sh | bashMake sure ~/.local/bin is in your PATH, then:
sshk create # Interactive wizard to create a new SSH key
sshk list # List all identities and authorized accesses
sshk copy github # Copy a public key to clipboard
sshk grant vela # Push a key to a remote server$ sshk
🔑 sshk — SSH Key Manager
Usage: sshk <command> [options]
Outgoing Identities
──────────────────────────────────────────────────
create Interactive creation wizard
list List everything (identities + access)
list --keys My identities only
list --auth Incoming access only
show <name> Identity details
copy <name> Copy public key
delete <name> Delete an identity
Incoming Access
──────────────────────────────────────────────────
grant <name> Authorize a remote machine
revoke <name> Revoke access
$ sshk create
› Name : github
› Type [1=ed25519, 2=rsa4096] [1] :
› Comment [git@github] :
› HostName (leave empty if sshk doesn't contact this machine) :
Name : github
Type : ed25519
File : ~/.ssh/keys/github/id_ed25519
Create? [Y/n]
✅ Key created.
✅ Created: ~/.ssh/config.d/github.conf
$ sshk list
NAME TYPE FINGERPRINT CREATED
──────────────────────────────────────────────────
github ed25519 SHA256:nsUE... 2026-03-03
vela ed25519 SHA256:s7N3... 2026-06-01
void ed25519 SHA256:gszk... 2026-06-01
$ sshk show vela
🔑 vela
Type : ed25519
Fingerprint : SHA256:s7N3Um...
Comment : sofian@vela
Created : 2026-06-01
Path : ~/.ssh/keys/vela/id_ed25519
Config : ~/.ssh/config.d/vela.conf
HostName : 100.77.184.28
ssh : ssh vela
copy : sshk copy vela
delete : sshk delete vela
$ sshk grant void
ℹ Copying public key to void (100.115.31.73)...
✅ Access granted → macbook authorized on void.
sshk organizes SSH keys into three directories under ~/.ssh/:
~/.ssh/
├── keys/ # Your identities (who you are)
│ ├── github/
│ │ └── id_ed25519
│ └── vela/
│ └── id_ed25519
├── config.d/ # SSH config snippets (ssh <name>)
│ ├── github.conf
│ └── vela.conf
└── authorized_keys.d/ # Who can connect to you
└── macbook
No more flat ~/.ssh/id_rsa mess. Each identity is namespaced, with a matching config snippet and authorized keys entry.
On first run, sshk creates ~/.config/sshk/config with defaults. Edit it to customize:
| Option | Default | Description |
|---|---|---|
SSHK_DEFAULT_TYPE |
ed25519 |
Default key type (ed25519 or rsa) |
SSHK_DEFAULT_USER |
$USER |
Default SSH user for HostName blocks |
SSHK_KEYS_DIR |
~/.ssh/keys |
Override keys directory |
SSHK_AUTH_DIR |
~/.ssh/authorized_keys.d |
Override authorized keys directory |
SSHK_CONFIG_DIR |
~/.ssh/config.d |
Override SSH config snippets directory |
On each server, enable authorized_keys.d/ once for grant to work:
mkdir -p ~/.ssh/authorized_keys.d
chmod 700 ~/.ssh/authorized_keys.d
echo 'AuthorizedKeysFile .ssh/authorized_keys .ssh/authorized_keys.d/*' | sudo tee -a /etc/ssh/sshd_config
sudo systemctl restart sshdsshk/
├── assets/
│ └── logo.svg
├── docs/
│ ├── assets/
│ │ ├── logo.png
│ │ ├── logo-512.png
│ │ └── screenshot.png
│ ├── screenshots/
│ │ ├── sshk-help.png
│ │ ├── sshk-list.png
│ │ └── sshk-show.png
│ └── index.html
├── install.sh
├── LICENSE
├── README.fr.md
├── README.md
└── sshk
Contributions are welcome. Here's how:
- Fork the repository
- Create a branch (
git checkout -b feat/amazing-feature) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feat/amazing-feature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.
