Gathering detailed insights and metrics for ssh2-keeper
Gathering detailed insights and metrics for ssh2-keeper
Gathering detailed insights and metrics for ssh2-keeper
Gathering detailed insights and metrics for ssh2-keeper
Store servers with tags, simple search to use as SSH2 connections
npm install ssh2-keeper
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
Apache-2.0 License
85 Commits
2 Forks
2 Watchers
55 Branches
3 Contributors
Updated on Jul 30, 2020
Latest Version
1.2.3
Package Id
ssh2-keeper@1.2.3
Unpacked Size
61.34 kB
Size
16.73 kB
File Count
18
NPM Version
6.4.1
Node Version
8.16.1
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Store servers with tags, simple search to use as SSH2 connections
Using an OSx (or Linux) environment, when you need to manage lot of servers it could be difficult to remember all the hostnames or ip addresses. On the Windows system I used to use mRemote, but I didn't find anything similar on OSx/Linux. That's the idea to create a simple CLI program allowing to store all the connection information using tags (like mRemote does).
To install you can simply using the latest version of the package deployed on the npmjs.org repository. For this simply use the following command:
1npm install -g ssh2-keeper
You will see the following output:
1/Users/Marco/.nvm/versions/node/v11.14.0/bin/sk -> /Users/Marco/.nvm/versions/node/v11.14.0/lib/node_modules/ssh2-keeper/index.js 2+ ssh2-keeper@1.2.2 3updated 1 package in 20.563s
Using the folder in the output of the installation output, you can configure with the desired parameters. The file is inside the config
folder. In my example it is /Users/Marco/.nvm/versions/node/v11.14.0/lib/node_modules/ssh2-keeper/config/default.json
1{ 2 "db_path": "/Users/mmornati/ssh2-keeper", 3 "server_collection": "servers", 4 "tag_collection": "tags", 5 "default_username": "mmornati", 6 "show_ssh_command": true 7}
You just need to select the db_path
part with the information you need.
It's a NodeJS project and actually it is not available on the npm repository. So, the better way is downloading sources from github and install globally from sources:
1git clone https://github.com/mmornati/ssh2-keeper.git 2cd ssk-keeper 3npm install -g .
The ssh2-keeper is now available as sk
command on your system.
After the global installation the configuration folder is into the global node modules installation folder. You can check which one is on your system using:
1npm root -g
On my system for example, the global folder is /usr/local/lib/node_modules which means, after the ssh2-keeper installation, the configuration folder will be /usr/local/lib/node_modules/ssh2-keeper/config
.
Inside this latest one you will find a default.json file and you must configure the database folder.
1{ 2 "db_path": "/Users/mmornati/ssh2-keeper", 3 "server_collection": "servers", 4 "tag_collection": "tags", 5 "default_username": "mmornati", 6 "show_ssh_command": true 7}
If you globally installed the module, using sk --help
allow you to retrieve the script documentation.
1Successfully connected to : ./db 2USAGE: node sk [OPTION1] [OPTION2]... arg1 arg2... 3The following options are supported: 4 -v, --verbose <ARG1> Show verbose log 5 -t, --tag <ARG1> Tag(s) to allow you to find server (multiple) 6 -h, --hostname <ARG1> Hostname of your server 7 -a, --admin_server <ARG1> If you need to connect to an Admin server to reach your target. Ex: ssh -tt pi@192.168.0.101 ssh -tt pi2@192.168.0.102 8 -i, --ip <ARG1> Server IP address. 9 -f, --identity_file <ARG1> Identity File 10 -u, --username <ARG1> Username to connect to your server. If empty the one in configuration file be used 11 -o, --operation <ARG1> One of ADD, SEARCH, UPDATE or REMOVE
1sk -o add -h server35.mornati.net -i 192.168.100.35 -t jenkins -t slave -t slave04 -t integration
This will add a server (if the hostname it is not already present with the same hostname) with the provided parameters and tags.
With a line like the previous one we've seen, you can also update server parameters:
1sk -o add -h server35.mornati.net -i 192.168.100.39
In this way, for example, if the server was already present into database, you will update the IP address. All others information already present into database will be kept. In the same way you can add a new tag to the server
1sk -o add -h server35.mornati.net -t mypersonalserver
will add a new tag to the server (if not already present).
Using the Update operation you can update a single server, using the hostname, or update all the servers related to a tag.
1~ sk -o update -h server20.mornati.net -u marco -f ~/.ssh/test_rsa
Using a tag, like in the followind example:
1~ sk -o update -t www -u mmornati -f ~/.ssh/test2_rsa
It will search foll all the servers tagged with www and set to anyone mmornati as username and ~/.ssh/test2_rsa as identity file.
This command will update the server20.mornati.net putting marco as username and ~/.ssh/test_rsa as identity file
The most used function will surely be the search one. You can search a server using the hostname, which will provide you the list of data known about the server:
1~ sk -o search -h server20.mornati.net 2Successfully connected to : ./db 3{ hostname: 'server20.mornati.net', 4 ip: '192.168.100.20', 5 tags: [ 'www', 'front', 'front02', 'preprod', 'france' ], 6 _id: '15404e5a1b134cb289ffae0cc89968ca' } 7Added to clipboard
Or you can search using tags: it will return you the intersection between all provided tags.
1~ sk -o search -t prod -t front -t italy 2Successfully connected to : ./db 3ssh mmornati@server1.mornati.net 4ssh mmornati@server2.mornati.net
It will return you all the 'front' and 'prod' servers for 'italy' (servers must have the 3 tags to be into the list). When the list gives you a single result, the ssh command will be directly in your clipboard: with a simple CTRL+V you can use it! :)
As I said before, this one is the most used function, I created an 'undocumented' function allowing you to search in this way:
1~ sk search prod front01 italy 2Successfully connected to : ./db 3ssh mmornati@server1.mornati.net 4Added to clipboard
So, without providing the option name. In this case:
To initialize my work environment database I used 'spreadsheet' (yes, it is amazing, but it was quick!).
I just copied hostnames and IPs I had on another document, and then, using the spreadsheet's CONCATENATE function I was able to generate the list of 'ADD' commands.
If you are using an admin server between you PC and the target server (for example on the configuration environment) you can store this information into the database (admin_server) and the ssh command sent by the ssh2-keeper will be ready to use.
1sk search preprod france front02 2Successfully connected to : ./db 3ssh -tt mmornati@adm01.mornati.net ssh -tt mmornati@server20.mornati.net 4Added to clipboard
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 1/25 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
29 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More