{"id":18716588,"url":"https://github.com/timothyye/skm","last_synced_at":"2025-04-12T14:19:31.905Z","repository":{"id":26055061,"uuid":"106516564","full_name":"TimothyYe/skm","owner":"TimothyYe","description":"A simple and powerful SSH keys manager","archived":false,"fork":false,"pushed_at":"2023-05-12T09:02:49.000Z","size":1867,"stargazers_count":971,"open_issues_count":3,"forks_count":51,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-04-12T14:19:24.999Z","etag":null,"topics":["ssh-key","ssh-manager","ssh-manager-cli"],"latest_commit_sha":null,"homepage":"https://timothyye.github.io/skm","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TimothyYe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null},"funding":{"github":"TimothyYe","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2017-10-11T06:52:55.000Z","updated_at":"2025-04-08T21:43:10.000Z","dependencies_parsed_at":"2022-07-27T05:46:38.713Z","dependency_job_id":"76f49adf-d5b3-4ef3-8f1a-3d817f45bc38","html_url":"https://github.com/TimothyYe/skm","commit_stats":{"total_commits":164,"total_committers":14,"mean_commits":"11.714285714285714","dds":"0.15243902439024393","last_synced_commit":"0591cb5fed3b072295d642fd05a81e756990c004"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimothyYe%2Fskm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimothyYe%2Fskm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimothyYe%2Fskm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimothyYe%2Fskm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TimothyYe","download_url":"https://codeload.github.com/TimothyYe/skm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248578875,"owners_count":21127714,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ssh-key","ssh-manager","ssh-manager-cli"],"created_at":"2024-11-07T13:13:09.519Z","updated_at":"2025-04-12T14:19:31.875Z","avatar_url":"https://github.com/TimothyYe.png","language":"Go","funding_links":["https://github.com/sponsors/TimothyYe"],"categories":[],"sub_categories":[],"readme":"![](https://raw.githubusercontent.com/TimothyYe/skm/master/assets/snapshots/skm.png)\n\n[![MIT licensed][5]][6] [![LICENSE](https://img.shields.io/badge/license-NPL%20(The%20996%20Prohibited%20License)-blue.svg)](https://github.com/996icu/996.ICU/blob/master/LICENSE) [![Build Status][1]][2] [![Go Report Card][7]][8] [![GoCover.io][11]][12] [![GoDoc][9]][10]\n\n[1]: https://travis-ci.org/TimothyYe/skm.svg?branch=master\n[2]: https://travis-ci.org/TimothyYe/skm\n[5]: https://img.shields.io/dub/l/vibe-d.svg\n[6]: LICENSE\n[7]: https://goreportcard.com/badge/github.com/timothyye/skm\n[8]: https://goreportcard.com/report/github.com/timothyye/skm\n[9]: https://godoc.org/github.com/TimothyYe/skm?status.svg\n[10]: https://godoc.org/github.com/TimothyYe/skm\n[11]: https://img.shields.io/badge/gocover.io-81.8%25-green.svg\n[12]: https://gocover.io/github.com/timothyye/skm\n\nSKM is a simple and powerful SSH Keys Manager. It helps you to manage your multiple SSH keys easily!\n\n![](https://github.com/TimothyYe/skm/blob/master/assets/snapshots/demo.gif?raw=true)\n\n## Features\n\n* Create, List, Delete your SSH key(s)\n* Manage all your SSH keys by alias names\n* Choose and set a default SSH key\n* Display public key via alias name\n* Copy default SSH key to a remote host\n* Rename SSH key alias name\n* Backup and restore all your SSH keys\n* Prompt UI for SSH key selection\n* Customized SSH key store path\n\n## Installation\n\n#### Homebrew\n\n```bash\nbrew tap timothyye/tap\nbrew install timothyye/tap/skm\n```\n\n#### Using Go\n\n```bash\ngo get github.com/TimothyYe/skm/cmd/skm\n```\n\n#### Manual Installation\n\nDownload it from [releases](https://github.com/TimothyYe/skm/releases) and extact it to /usr/bin or your PATH directory.\n\n## Usage\n```bash\n% skm\n\nSKM V0.8.5\nhttps://github.com/TimothyYe/skm\n\nNAME:\n   SKM - Manage your multiple SSH keys easily\n\nUSAGE:\n   skm [global options] command [command options] [arguments...]\n\nVERSION:\n   0.8.5\n\nCOMMANDS:\n     init, i      Initialize SSH keys store for the first time usage.\n     create, c    Create a new SSH key.\n     ls, l        List all the available SSH keys.\n     use, u       Set specific SSH key as default by its alias name.\n     delete, d    Delete specific SSH key by alias name.\n     rename, rn   Rename SSH key alias name to a new one.\n     copy, cp     Copy current SSH public key to a remote host.\n     display, dp  Display the current SSH public key or specific SSH public key by alias name.\n     backup, b    Backup all SSH keys to an archive file.\n     restore, r   Restore SSH keys from an existing archive file.\n     cache        Add your SSH to SSH agent cache via alias name.\n     help, h      Shows a list of commands or help for one command.\n\nGLOBAL OPTIONS:\n   --store-path value   Path where SKM should store its profiles (default: \"/Users/timothy/.skm\")\n   --ssh-path value     Path to a .ssh folder (default: \"/Users/timothy/.ssh\")\n   --restic-path value  Path to the restic binary\n   --help, -h           show help\n   --version, -v        print the version\n```\n\n### For the first time use\n\nYou should initialize the SSH key store for the first time use:\n\n```bash\n% skm init\n\n✔ SSH key store initialized!\n```\n\nSo, where are my SSH keys?\nSKM will create SSH key store at ```$HOME/.skm``` and put all the SSH keys in it.\n\n__NOTE:__ If you already have id_rsa \u0026 id_rsa.pub key pairs in ```$HOME/.ssh```, SKM will move them to ```$HOME/.skm/default```\n\n### Create a new SSH key\n__NOTE:__ Currently __ONLY__ RSA and ED25519 keys are supported!\n\n```bash\nskm create prod -C \"abc@abc.com\" -t ed25519\n\nGenerating public/private rsa key pair.\nEnter passphrase (empty for no passphrase):\nEnter same passphrase again:\nYour identification has been saved in /Users/timothy/.skm/prod/id_rsa.\nYour public key has been saved in /Users/timothy/.skm/prod/id_rsa.pub.\n...\n✔ SSH key [prod] created!\n```\n\n### List SSH keys\n```bash\n% skm ls\n\n✔ Found 3 SSH key(s)!\n\n-\u003e      default\n        dev\n        prod\n```\n### Set default SSH key\n```bash\n% skm use dev\nNow using SSH key: dev\n```\n\n### Prompt UI for key selection\n\nYou can just type ```skm use```, then a prompt UI will help you to choose the right SSH key:\n\n![](https://github.com/TimothyYe/skm/blob/master/assets/snapshots/prompt.gif?raw=true)\n\n### Display public key\n\n```bash\n% skm display\n```\n\nOr display specific SSH public key by alias name:\n\n```bash\n% skm display prod\n```\n\n### Delete a SSH key\n\n```bash\n% skm delete prod\n\nPlease confirm to delete SSH key [prod] [y/n]: y\n✔ SSH key [prod] deleted!\n```\n### Copy SSH public key to a remote host\n\n```bash\n% skm cp timothy@example.com\n\n/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: \"/Users/timothy/.skm/default/id_rsa.pub\"\n/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed\n/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys\ntimothy@example.com's password:\n\nNumber of key(s) added:        1\n\nNow try logging into the machine, with:   \"ssh 'timothy@example.com'\"\nand check to make sure that only the key(s) you wanted were added.\n\n✔  Current SSH key already copied to remote host\n```\n\n### Rename a SSH key with a new alias name\n\n```bash\n% skm rn test tmp\n✔  SSH key [test] renamed to [tmp]\n```\n\n### Backup SSH keys\n\nBackup all your SSH keys to $HOME directory by default.\n\n```bash\n% skm backup\n\na .\na ./test\na ./default\na ./dev\na ./dev/id_rsa\na ./dev/id_rsa.pub\na ./default/id_rsa\na ./default/id_rsa.pub\na ./test/id_rsa\na ./test/id_rsa.pub\n\n✔  All SSH keys backup to: /Users/timothy/skm-20171016170707.tar\n```\n\nIf you have [restic](https://restic.net/) installed then you can also use that\nto create backups of your SKM store:\n\n```bash\n# First, you need a password for your repository\n% if [[ ! -f ~/.skm-backups.passwd ]]; then\n%     openssl rand -hex 64 \u003e ~/.skm-backups.passwd\n% fi\n\n% skm backup --restic\nrepository ... opened successfully, password is correct\n\nFiles:           0 new,     1 changed,     4 unmodified\nDirs:            0 new,     0 changed,     0 unmodified\nAdded to the repo: 1.179 KiB\n\nprocessed 5 files, 2.593 KiB in 0:00\nsnapshot $SNAPSHOT saved\n✔  Backup to /Users/$USER/.skm-backups complete\n```\n\n### Restore SSH keys\n\n```bash\n% skm restore ~/skm-20171016172828.tar.gz                                                                                           \nx ./\nx ./test/\nx ./default/\nx ./dev/\nx ./dev/id_rsa\nx ./dev/id_rsa.pub\nx ./default/._id_rsa\nx ./default/id_rsa\nx ./default/._id_rsa.pub\nx ./default/id_rsa.pub\nx ./test/id_rsa\nx ./test/id_rsa.pub\n\n✔  All SSH keys restored to /Users/timothy/.skm\n```\n\nAgain, SKM also supports [restic](https://restic.net/) to create and restore\nbackups:\n\n```bash\n% skm restore --restic --restic-snapshot $SNAPSHOT\nrepository $REPO opened successfully, password is correct\nrestoring \u003cSnapshot $SNAPSHOT of [/Users/$USER/.skm] at 2018-10-03 19:40:33.333130348 +0200 CEST by $USER@$HOST\u003e to /Users/$USER/.skm\n✔  Backup restored to /Users/$USER/.skm\n```\n\n### Integrate with SSH agent\n\nYou can use `cache` command to cache your SSH key into SSH agent's cache via SSH alias name.\n\n__Cache your SSH key__  \n\n```bash\nλ tim [~/]\n→ skm cache --add my                                                                                                                                                                                                                                                                     \nEnter passphrase for /Users/timothy/.skm/my/id_rsa:\nIdentity added: /Users/timothy/.skm/my/id_rsa (/Users/timothy/.skm/my/id_rsa)\n✔  SSH key [my] already added into cache\n```\n\n__Remove your SSH key from cache__  \n\n```bash\nλ tim [~/]\n→ ./skm cache --del my                                                                                                                                                                                                                                                                   \nIdentity removed: /Users/timothy/.skm/my/id_rsa (MyKEY)\n✔  SSH key [my] removed from cache\n```\n\n__List your cached SSH keys from SSH agent__  \n\n```bash\nλ tim [~/]\n→ ./skm cache --list                                                                                                                                                                                                                                                                     \n2048 SHA256:qAVcwc0tdUOCjH3sTskwxAmfMQiL2sKtfPBXFnUoZHQ /Users/timothy/.skm/my/id_rsa (RSA)\n```\n\n### Customized SSH key store path\n\nBy default, SKM uses `$HOME/.skm` as the default path of SSH key store.\nYou can define your customized key store path in your `~/.bashrc` or `~/.zshrc` by adding:\n\n```bash\nSKM_STORE_PATH=/usr/local/.skm\n```\n\n### Hook mechanism\n\nEdit and place a executable file named ```hook``` at the specified key directory, for example:\n\n```bash\n~/.skm/prod/hook\n```\n\nThis hook file can be both an executable binary file or an executable script file.\n\nSKM will call this hook file after switching default SSH key to it, you can do some stuff in this hook file. \n\nFor example, if you want to use different git username \u0026 email after you switch to use a different SSH key, you can create one hook file, and put shell commands in it:\n\n```bash\n#!/bin/bash\ngit config --global user.name \"YourNewName\"\ngit config --global user.email \"YourNewEmail@example.com\"\n```\n\nThen make this hook file executable:\n\n```bash\nchmod +x hook\n```\n\nSKM will call this hook file and change git global settings for you!\n\n## Licence\n\n[MIT License](https://github.com/TimothyYe/skm/blob/master/LICENSE)  \n[996ICU License](https://github.com/lxlxw/996.TSC/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimothyye%2Fskm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimothyye%2Fskm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimothyye%2Fskm/lists"}