npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

nssh

v1.3.1

Published

ssh key manager

Downloads

30

Readme


Build Status codecov MIT licensed NPM Downloads GitHub last commit

NSSH

NSSH is a SSH Keys Manager for node.js command-line interfaces.
It can generate a ssh key and set ssh key config and copy the public key to a remote host with one commond.
then you can use ssh login with name, no need for passwords. 
Inspired by TimothyYe/skm , which is written in go language.

image

Features

* generate a ssh key and set ssh key config and copy the public key to a remote host with one commond
* Manage all your SSH keys by alias names
* Choose and set a default SSH key
* Copy default SSH key to a remote host
* Rename SSH key alias name

Installation

npm install nssh -g

Usage

$ nssh

Usage: nssh <command> [options]

Options:

    -V, --version      output the version number
    -v, --version      get version
    -t, --type <n>      0:Only create a new ssh key
                        1:Create a new ssh key and set ssh key config
                        2:Create a new ssh key and copy new ssh key to remote host
                        3:Create a new ssh key and copy new ssh key to remote host and set ssh key config

    -H --host [value]  Remote host address, you can include the usename and port, E.g: [email protected]:22
    -u --user [value]  Remote host of username, default root
    -p --port [value]  Remote host of port, default 22
    -N --new_passphrase [value]  Generate ssh key's new_passphrase
    -h, --help         output usage information


Basic Examples:

    # Initialize SSH keys store
    $ nssh init

    # List all the store SSH keys
    $ nssh ls

    # Create a new ssh key
    $ nssh create node0

    # Create a new ssh key and set its config
    $ nssh create node1 -t 1 -H [email protected]

    # Create a new ssh key for github and set its config
    $ nssh create github.com -t 1 -H [email protected]

    # Create a new ssh key and copy public key to a remote host
    $ nssh create node1 -t 2 -H [email protected]

    # Create a new ssh key and set its config and copy public key to a remote host
    $ nssh create node1 -t 3 -H [email protected]

    # Copy ssh public key to a remote host
    $ nssh copy node1 [email protected]

    # Remove ssh key
    $ nssh rm default

    # Rename ssh key
    $ nssh rn default new

    # Switch to use the specified SSH key
    $ nssh use default

For the first time use

$ nssh init
✔ ssh key store initialized!
sh key store location is:C:\Users\liuyt\.nssh\

NOTE: If you already have id_rsa & id_rsa.pub key pairs in $HOME/.ssh, NSSH will move them to $HOME/.nssh/default

Create a new SSH key

$ nssh create work1 -t 3 -H [email protected]
Generating public/private rsa key pair.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in C:\Users\liuyt\.nssh\.tmp\id_rsa.
Your public key has been saved in C:\Users\liuyt\.nssh\.tmp\id_rsa.pub.
The key fingerprint is:
SHA256:IoWtg5M1+7VUANVB/JdU2EYVGjzMh5he/iSkwNfjRp4 liuyt@DESKTOP-48BGCR8
The key's randomart image is:
+---[RSA 2048]----+
|      .o++o.B..**|
|     o   +o+ %=.o|
|    + o   =.Oo=o |
|   + =   . o.Eo. |
|  + = . S   ..+  |
|   . + + .     . |
|      . .        |
|                 |
|                 |
+----[SHA256]-----+
create ssh key success
ssh-copy-id: INFO: Source of key(s) to be installed: "C:\Users\liuyt\.nssh\.tmp\id_rsa.pub"
ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
[email protected]'s password:

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh '[email protected]'"
and check to make sure that only the key(s) you wanted were added.

copy ssh key success

add ssh key success

✔  ssh key [work1] created


$ ssh work1
Welcome to Ubuntu 16.04.2 LTS (GNU/Linux 4.4.0-63-generic x86_64)

* Documentation:  https://help.ubuntu.com
* Management:     https://landscape.canonical.com
* Support:        https://ubuntu.com/advantage

Welcome to Alibaba Cloud Elastic Compute Service !

Last login: Thu Dec  7 16:56:53 2017 from 2.3.1.1
root@iZ1193ih9wgZ:~#

List SSH keys

$ nssh ls
✔  Found 2 ssh key(s)!

->  test (current)
    test2

Set default SSH key

$ nssh use test2
✔  Now using SSH key: [test2]

$ nssh ls
✔  Found 2 ssh key(s)!

    test
->  test2 (current)

Rename a SSH key with a new alias name

$ nssh rn test2 new
✔  ssh key [test2] renamed to [new]'

$ nssh ls
✔  Found 2 ssh key(s)!

->  new (current)
    test2

Remove a SSH key

$ nssh rm new
? confirm to remove [new]? (Y/n)
? confirm to remove [new]? Yes
✔  ssh key [new] removed

$ nssh ls
✔  Found 1 ssh key(s)!

    test2

Copy SSH public key to a remote host

$ nssh cp test2 139.196.39.155
ssh-copy-id: INFO: Source of key(s) to be installed: "C:\Users\liuyt\.nssh\test2\id_rsa.pub"
ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
[email protected]'s password:

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh '[email protected]'"
and check to make sure that only the key(s) you wanted were added.

copy ssh key success

Licence

MIT License