Giter Club home page Giter Club logo

sshm's Introduction

SSHM

Description

Easy connect on EC2 instances thanks to AWS System Manager Agent. Just use your ~/.aws/profile to easily select the instance you want to connect or on create a tunnel to.

Why

SSH is great, SSH is useful, we do love SSH as the sysdadmins we are but AWS doesn't let us add several keys except with a custom userdata or else. With SSH we have to set up a bastion and open security groups to some CIDR or even use a VPN. AWS SSM Agent permits to simplify this process, no need to share keys, no port to open, no instance to set up, you only use your IAM (with MFA) user and all which is done is logged in S3. See :https://docs.aws.amazon.com/systems-manager/latest/userguide/what-is-systems-manager.html.

Prerequisites

Install session-manager-plugin : https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html (minimum version : 1.1.35.0)

Usage

Usage of sshm:
  -i string
        InstanceID for direct connection
  -lpn string
        Local Port Number for Proxy
  -p string
        Profile from ~/.aws/config
  -pn string
        Port Number for Proxy
  -r string
        Region, default is eu-west-1 (default "eu-west-1")

You can select your instance by ←, ↑, → ↓ and filter by Tag:Name, InstanceId, Hostname, PrivateIp, PublicIp, etc. Enter key to validate.

If -lpn and -pn are specified, a tunnel is started :

$ sshm -lpn 9999 -pn 80
 
...

Starting session with SessionId: 1576756257508463700-0c3b74e1f450c5d5a
Port 9999 opened for sessionId 1576756257508463700-0c3b74e1f450c5d5a.

Legend :

  • Online : all running instances with a SSM Agent connected
  • Offline : all instances with a SSM Agent disconnected (agent down or instance is stopped)
  • Running : all running instances with or without SSM Agent installed

Output Example

screenshot1 screenshot2

Build

go build

This repository uses go mod, so don't git clone inside your $GOPATH.

Author

Thomas Labarussias ([email protected] - https://github.com/Issif)

sshm's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.