A command line tool to manage SSH keys.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
img
src
test
.gitignore
.travis.yml
LICENSE
README.md
index.js
package-lock.json
package.json

README.md


Build Status codecov MIT licensed

One of the SSH Keys Manager implementation in Node.js. Inspired by TimothyYe/skm , which is written in go language.

Features

  • Create new SSH and named with alias
  • Manage the SSH keys with alias (Delete/Rename/List)
  • Switch default SSH keys (in ~/.ssh) with alias
  • Archive/Restore SSH keys
  • Copy key to remote host

Installation

npm install -g my-skm

Usage

Overview

  Usage: mskm <command> [options]


  Options:

    -V, --version  output the version number
    -h, --help     output usage information


  Commands:

    init|i                        Initialize SSH key storage
    create|c <alias> [options]    Create SSH key with alias, support ssh-keygen options.
    ls|l                          List all the stored keys
    use|u <alias>                 Change keyset to current use
    remove|rm <alias>             Remove SSH with alias
    rename|rn <alias> [newAlias]  Rename SSH key to new alias
    backup|b <target>             Backup store to <target> achive file.
    restore|r <source>            Restore from <source> achive file.
    send|s <host> [alias]         Send identity to <host> omit alias for key inuse.

Initialize key store

Before using the command, initialize is required. It will try to create the key store for user keys. If there's already keys in ~/.ssh, it will be saved as alias 'default'.

mskm init

Create SSH key

Create a SSH key with alias(based on SSH-KEYGEN), supported options of SSH-KEYGEN, such as comment (-C [comment]).

mskm create <alias> [options]

List SSH keys

List all the SSH key sets in store.

mskm ls

Key in using will be hignlighted with arrow mark '->'.

    dev
 -> prod
    test

Use SSH key

Change default key(in ~/.ssh) to alias key set.

mskm use <alias>

Rename SSH key

Rename the alias.

mskm rename <alias> <newAlias>

Remove SSH key

Remove the alias from store

mskm remove <alias>

Archive the key store

Archive all the alias in store to specific path.

mskm backup <target>

Restore the key store

Restore all the alias from archiver in specific path.

mskm restore <source>

Send keys

Send the identity to remote host, if alias is given will send will alias' public key. Default sending the public key inusing.

mskm send <host> [alias]

License

MIT License