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

nc-aws-ssh

v1.0.0

Published

AWS SSH Client

Downloads

2

Readme

Introduction

This tool is used to get a list of dynamic ec2 instances and establish ssh connection to them.

Features

It uses ec2 instance tags to search for metadata, such as available users, vault otp role, vault otp mount point, instance role.

Installation

npm install -g nc-aws-ssh

Setup

AWS

You need to configure your aws profiles and credentials. You can use AWS CLI to manage profile and credentials: Configuration and Credential Files.

  • Environment variables AWS_CONFIG_FILE and AWS_SHARED_CREDENTIALS_FILE supported as well
  • Environment variable AWS_REGION are used to specify aws region fallback, if profile doesn't contain it

Config file ~/.aws/config:

[profile my_awesome_profile]
source_profile = default
role_arn = arn:aws:iam::12345678901:role/OrganizationAccountAccessRole
region = us-west-1
  • my_awesome_profile - profile name that is used as menu point
  • role_arn - arn of aws role, that will be assumed for aws api calls
  • region - aws region for aws api calls (if not specified, fallback to AWS_REGION environment variable is used)
  • source_profile - profile credentials (see below)

Credentials file ~/.aws/credentials:

[default]
aws_access_key_id = YAIAT7G7HEYH7YCQAA5Q
aws_secret_access_key = Hi0ohk8voo6RoTMPbuqdpP/Cpsa3+iekoothiC4

Vault OTP

To use Vault OTP you need to:

  • Use VAULT_ADDR environment variable, e.g. https://vault.example.com
  • Use VAULT_TOKEN environment variable or create ~/.vault-token file that contains vault token (see vault auth)
  • Install sshpass locally.
  • If you use bastion, install sshpass there, and configure ssh server with AllowTcpForwarding on option.

See vault auth (vault auth -method=ldap username=...)

Instances metadata

Tags

Role (tag: role)

If a list of instances contains bastion (role=bastion), it will be used to connect to other instance through bastion, otherwise (if role != bastion) use direct connection.

Users (nc_aws_ssh:users)

A comma-separated list of usernames that can be used to login to the instance (e.g. "ubuntu,visitor")

Vault OTP Role (nc_aws_ssh:vault_otp_role)

Vault ssh otp backend role name. See Vault OTP Role

Vault OTP Mount (nc_aws_ssh:vault_otp_mount)

Vault mount point for ssh otp backend. See Vault OTP Mount

CLI

Dry run

Generate and print to terminal ssh connection command, without executing it:

nc-aws-ssh --dry-run 
# sshpass -p ... ssh -o StrictHostKeyChecking=no  -o ProxyCommand="sshpass -p ... ssh -o StrictHostKeyChecking=no  "[email protected]" -W %h:%p" "[email protected]"

Verbose

To retrieve extended optput, add verbose (-v) option to generated ssh connection command:

nc-aws-ssh --verbose