A simple and powerful SSH keys manager
SKM is a simple and powerful SSH Keys Manager. It helps you to manage your multiple SSH keys easily!
--key, --pick, --dry-run)fingerprint and infoskm doctorskm auditskm publishskm trash list|restore|emptypost-use, post-create, pre-delete, post-copy events (per-key and global)Starting from v0.8.9, skm has been officially submitted to the homebrew-core repository, so you can install it directly on both macOS and Linux:
brew install skmIf you previously installed
skmthrough the old tap, please remove it first to avoid conflicts:brew uninstall skm brew untap timothyye/tap brew install skm
go get github.com/TimothyYe/skm/cmd/skmDownload it from releases and extact it to /usr/bin or your PATH directory.
…You should initialize the SSH key store for the first time use:
% skm init
✔ SSH key store initialized!So, where are my SSH keys?
SKM will create SSH key store at $HOME/.skm and put all the SSH keys in it.
NOTE: If you already have id_rsa & id_rsa.pub key pairs in $HOME/.ssh, SKM will move them to $HOME/.skm/default
Supported key types: ed25519 (default), rsa, ed25519-sk, ecdsa-sk. The
-sk variants are FIDO2 hardware-backed keys and require ssh-keygen 8.2+
plus a security key (YubiKey, Solo, etc.) plugged in at creation time.
% skm create prod -C "[email protected]"
Generating public/private ed25519 key pair.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /Users/timothy/.skm/prod/id_ed25519.
Your public key has been saved in /Users/timothy/.skm/prod/id_ed25519.pub.
...
✔ SSH key [prod] created!Other examples:
skm create old -t rsa -b 4096 # RSA (minimum 3072 bits enforced)
skm create yubi -t ed25519-sk # hardware-backed; prompts for PIN + touchRSA keys below 3072 bits are rejected — skm audit flags those as weak, so
create and audit agree on what's safe. Use ssh-keygen directly if you
need a smaller key for testing.
By default ls shows alias, key type, and comment in three columns; the
active default key is marked with ->. Use -l / --long for the full table
with bits, fingerprint, agent status, and the modification date.
…Other useful flags:
skm ls -q # quiet — just the alias names, default marked with ->
skm ls --json # machine-readable output for scripting
skm ls -t ed25519 # filter by key type% skm use dev
Now using SSH key: devYou can just type skm use, then a prompt UI will help you to choose the right SSH key:
% skm displayOr display specific SSH public key by alias name:
% skm display prod% skm delete prod
Please confirm to delete SSH key [prod] [y/n]: y
✔ SSH key [prod] moved to trash (restore with: skm trash restore prod-20260521150412)By default a delete moves the alias into the store's trash so it can be recovered. Pass multiple aliases to batch-delete; missing aliases are reported and skipped. -y / --yes skips the confirmation, --purge hard-deletes (skipping the trash):
% skm delete -y staging legacy old-laptop
% skm delete --purge --yes ancient% skm trash list
NAME ALIAS DELETED
prod-20260521150412 prod 2026-05-21 15:04:12
% skm trash restore prod-20260521150412
✔ Restored [prod-20260521150412] as alias [prod]You can pass either the trash entry name (prod-20260521150412) or just the alias (prod); the latter works when only one trashed entry matches. If the original alias is already taken, pass --as . Empty the trash with skm trash empty (prompts for confirmation; -y to skip).
By default the currently active key is pushed:
% skm cp [email protected]
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/Users/timothy/.skm/default/id_rsa.pub"
...
✔ SSH key copied to remote hostUseful flags:
skm cp --key work [email protected] # push a specific key, not the default
skm cp --pick [email protected] # interactively choose the key
skm cp -p 2222 [email protected] # non-default SSH port
skm cp timothy@[2001:db8::1]:2222 # IPv6 hosts work too
skm cp --dry-run [email protected] # preview the ssh-copy-id command% skm rn test tmp
✔ SSH key [test] renamed to [tmp]Backup all your SSH keys to a tarball in $HOME.
% skm backup
a .
a ./default/id_rsa
a ./default/id_rsa.pub
…
✔ All SSH keys backup to: /Users/timothy/skm-20260521221544.tar.gz
⚠ This bundle contains UNENCRYPTED private keys. If it leaves this
machine, anyone with the file can use your keys. Re-run with
--encrypt to produce an encrypted archive.The default tar contains your private keys in the clear. To produce an
encrypted bundle (AES-256-CBC via openssl, same envelope as skm export --encrypt), pass --encrypt:
% skm backup --encrypt
enter AES-256-CBC encryption password:
Verifying - enter AES-256-CBC encryption password:
✔ All SSH keys backup to: /Users/timothy/skm-20260521221544.tar.gz.enc
Decrypt with: openssl enc -d -aes-256-cbc -pbkdf2 -in /Users/timothy/skm-20260521221544.tar.gz.enc -out skm-20260521221544.tar.gzFor scripted use, pass --password-file to read the passphrase from a
file instead of prompting.
If you have restic installed, SKM can use it to produce encrypted, deduplicated, snapshot-style backups that can target local disk, S3, Cloudflare R2, Backblaze B2, SFTP, and any other backend restic supports. Run the one-time interactive setup first:
…Then run repeat backups:
% skm backup --restic
✔ Backup to s3:https://abc.r2.cloudflarestorage.com/skm completeRestic encrypts every chunk client-side before upload, so the remote destination never sees plaintext. The R2/S3 credentials and the restic password are independent secrets — losing the credentials means re-issuing them; losing the restic password means the backup is unrecoverable.
% skm restore ~/skm-20260521221544.tar.gz
✔ All SSH keys restored to /Users/timothy/.skm.enc bundles are auto-detected and decrypted before extraction:
% skm restore ~/skm-20260521221544.tar.gz.enc
enter AES-256-CBC decryption password:
✔ All SSH keys restored to /Users/timothy/.skmFor restic-backed backups, pick a snapshot to restore:
% skm restore --restic --restic-snapshot $SNAPSHOT
✔ Backup restored to /Users/$USER/.skmOmit --restic-snapshot and SKM will list the available snapshots.
Pull an existing key pair from anywhere on disk into the SKM store. The
matching half of the pair is inferred from the .pub suffix; the key type
is detected from the public key's header.
% skm import --alias work ~/old-laptop/.ssh/id_ed25519
✔ Imported ed25519 key as [work]skm import also accepts an skm export bundle (.tar.gz, .tgz, or
.tar.gz.enc). For encrypted bundles, openssl prompts for the passphrase.
% skm import ~/skm-work-20260516193629.tar.gz.enc
enter aes-256-cbc decryption password:
✔ Imported bundle as [work]Useful flags:
skm import --alias newname bundle.tar.gz # rename the alias on the way in
skm import --move ~/old/id_ed25519 # remove the source after a successful copyNote: put
--alias/--movebefore the path argument — flags placed after the path are not parsed, and SKM will error out with a hint if it sees one.
Bundle one alias into a portable archive that you can move to another
machine and import there. The archive contains the private key, the public
key, and any hook file under that alias.
% skm export work
✔ Exported [work] to /Users/timothy/skm-work-20260516193629.tar.gzAdd --encrypt to wrap the bundle with openssl enc -aes-256-cbc -pbkdf2,
which prompts for a passphrase:
% skm export --encrypt work
enter aes-256-cbc encryption password:
Verifying - enter aes-256-cbc encryption password:
✔ Exported [work] to /Users/timothy/skm-work-20260516193629.tar.gz.encYou can also specify the output path:
skm export -o /tmp/work.tar.gz work% skm fingerprint work
SHA256:pFsC7J7L9L08f3w8uP6ozRaGW5Dg8CdEkP8iVj7++pw
% skm info work
Alias work
Default yes
Type ed25519
Bits 256
Fingerprint SHA256:pFsC7J7L9L08f3w8uP6ozRaGW5Dg8CdEkP8iVj7++pw
Comment work@laptop
In agent yes
Private /Users/timothy/.skm/work/id_ed25519
Public /Users/timothy/.skm/work/id_ed25519.pub
Modified 2026-05-16 19:56:07Both commands default to the active key when no alias is given.
skm passphrase wraps ssh-keygen -p. Use an empty new passphrase at the
prompt to remove the existing one.
% skm passphrase work
Updating passphrase for [work] (/Users/timothy/.skm/work/id_ed25519)
Enter new passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved with the new passphrase.
✔ Passphrase updated for [work]skm doctor walks through the most common environment problems — missing
SSH binaries, an unreachable ssh-agent, unwritable store paths, the
default key not resolving, RSA keys below 3072 bits, public/private files
with loose permissions, or hook scripts missing the executable bit.
% skm doctor
✔ ssh-keygen available
✔ ssh-add available
✔ ssh-copy-id available
✔ ssh-agent reachable with identities loaded
✔ /Users/timothy/.skm writable (mode -rwxr-xr-x)
✔ /Users/timothy/.ssh writable (mode -rwxr-xr-x)
✔ default key [work] resolves to /Users/timothy/.skm/work/id_ed25519
✔ private key id_ed25519 mode -rw---No open issues yet, or sync has not completed.