All Projects → itsdalmo → Ssm Sh

itsdalmo / Ssm Sh

Licence: mit
Experiment to use SSM RunCommand instead of SSH

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Labels

Projects that are alternatives of or similar to Ssm Sh

Javaweb Project
初学JAVA-WEB开发的小项目💖
Stars: ✭ 347 (+147.86%)
Mutual labels:  ssm, ssh
Ssh Over Ssm
SSH over AWS SSM. No bastions or public-facing instances. SSH user management through IAM. No requirement to store SSH keys locally or on server.
Stars: ✭ 541 (+286.43%)
Mutual labels:  aws, ssm
Bridgy
cloud inventory + ssh + tmux + sshfs
Stars: ✭ 374 (+167.14%)
Mutual labels:  aws, ssh
Awsssmchaosrunner
Amazon's light-weight library for chaos engineering on AWS. It can be used for EC2, ECS (with EC2 launch type) and Fargate.
Stars: ✭ 214 (+52.86%)
Mutual labels:  aws, ssm
Ec2connect
Stars: ✭ 53 (-62.14%)
Mutual labels:  aws, ssh
Bless
Repository for BLESS, an SSH Certificate Authority that runs as a AWS Lambda function
Stars: ✭ 2,627 (+1776.43%)
Mutual labels:  aws, ssh
Gbt
Highly configurable prompt builder for Bash, ZSH and PowerShell written in Go.
Stars: ✭ 457 (+226.43%)
Mutual labels:  aws, ssh
Bastillion Ec2
A web-based SSH console to execute commands and manage multiple EC2 instances simultaneously running on Amazon Web Services (AWS).
Stars: ✭ 410 (+192.86%)
Mutual labels:  aws, ssh
Xiringuito
SSH-based "VPN for poors"
Stars: ✭ 969 (+592.14%)
Mutual labels:  aws, ssh
Aws Ec2 Ssh
Manage AWS EC2 SSH access with IAM
Stars: ✭ 796 (+468.57%)
Mutual labels:  aws, ssh
Gossm
💻Interactive CLI tool that you can connect to ec2 using commands same as start-session, ssh in AWS SSM Session Manager
Stars: ✭ 192 (+37.14%)
Mutual labels:  aws, ssh
Sshremotekeys
Managing SSH keys remotely to control access to hosts
Stars: ✭ 70 (-50%)
Mutual labels:  aws, ssh
Aws Virtual Bastion
A web based terminal for EC2 instances that does not require SSH or any other inbound connections to the instaces. Instead it uses the AWS Systems Manager (SSM) API to run commands (bash or powershell).
Stars: ✭ 166 (+18.57%)
Mutual labels:  aws, ssm
Aws Gate
Better AWS SSM Session manager CLI client
Stars: ✭ 294 (+110%)
Mutual labels:  aws, ssh
Javaweb Project Source Share
🌱🚀分享基于Servlet、SSH、SSM、SpringBoot等流行技术实现的JavaWeb项目,难度分为5个等级,帮助小白入门JavaWeb开发,协助JavaWeb开发者熟悉最新技术
Stars: ✭ 229 (+63.57%)
Mutual labels:  ssm, ssh
Opscloud
运维管理平台(阿里云),自动同步阿里云配置信息,堡垒机(容器),批量运维,Kubernetes,Zabbix管理等功能
Stars: ✭ 788 (+462.86%)
Mutual labels:  aws, ssh
Module Security Public
The public documentation for the gruntwork-io/module-security repo, which contains packages for setting up best practices for managing secrets, credentials, and servers
Stars: ✭ 67 (-52.14%)
Mutual labels:  aws, ssh
Generate Ssh Configs
Automatically generate ssh config files for your cloud servers
Stars: ✭ 136 (-2.86%)
Mutual labels:  aws, ssh
Spark On Lambda
Apache Spark on AWS Lambda
Stars: ✭ 137 (-2.14%)
Mutual labels:  aws
Learn Devops
🚧 Learn the craft of "DevOps" (Developer Operations) to Deploy your App and Monitor it so it stays "Up"!
Stars: ✭ 139 (-0.71%)
Mutual labels:  aws

SSM shell

Build Status

Little experiment to mimic SSH by using SSM agent to send commands to remote instances and fetching the output.

Install

Grab a binary from the releases.

Docker

There is also a docker image here.

Manual install

Have Go installed:

$ which go
/usr/local/bin/go

$ echo $GOPATH
/Users/dalmo/go

$ echo $PATH
# Make sure $GOPATH/bin is in your PATH.

Get the repository:

go get -u github.com/itsdalmo/ssm-sh

If everything was successful, you should have a shiny new binary:

which ssm-sh
# Should point to $GOPATH/bin/ssm-sh

Usage

$ ssm-sh --help

Usage:
  ssm-sh [OPTIONS] <command>

Application Options:
  -v, --version  Print the version and exit.

AWS Options:
  -p, --profile= AWS Profile to use. (If you are not using Vaulted).
  -r, --region=  Region to target. (default: eu-west-1)

Help Options:
  -h, --help     Show this help message

Available commands:
  describe  Description a document from ssm.
  list      List managed instances or documents. (aliases: ls)
  run       Run a command or document on the targeted instances.
  shell     Start an interactive shell. (aliases: sh)

List instances usage

$ ssm-sh list instances --help

...
[instances command options]
      -f, --filter= Filter the produced list by tag (key=value,..)
      -l, --limit=  Limit the number of instances printed (default: 50)
      -o, --output= Path to a file where the list of instances will be written as JSON.

List documents usage

$ ssm-sh list documents --help

...
[documents command options]
      -f, --filter= Filter the produced list by property (Name, Owner, DocumentType, PlatformTypes)
      -l, --limit=  Limit the number of instances printed (default: 50)

Run cmd/shell usage

$ ssm-sh run cmd --help

...
[cmd command options]
      -i, --timeout=       Seconds to wait for command result before timing out. (default: 30)
      -t, --target=        One or more instance ids to target
          --target-file=   Path to a JSON file containing a list of targets.

    SSM options:
      -x, --extend-output  Extend truncated command outputs by fetching S3 objects containing full ones
      -b, --s3-bucket=     S3 bucket in which S3 objects containing full command outputs are stored. Required when --extend-output is provided.
      -k, --s3-key-prefix= Key prefix of S3 objects containing full command outputs.

Run document usage

$ ssm-sh run document --help

...
[document command options]
      -n, --name=          Name of document in ssm.
      -i, --timeout=       Seconds to wait for command result before timing out. (default: 30)
      -p, --parameter=     Zero or more parameters for the document (name:value)
      -t, --target=        One or more instance ids to target
          --target-file=   Path to a JSON file containing a list of targets.

    SSM options:
      -x, --extend-output  Extend truncated command outputs by fetching S3 objects containing full ones
      -b, --s3-bucket=     S3 bucket in which S3 objects containing full command outputs are stored. Required when --extend-output is provided.
      -k, --s3-key-prefix= Key prefix of S3 objects containing full command outputs.

Example

$ vaulted -n lab-admin -- ssm-sh list instances --filter Name="*itsdalmo" -o example.json

Instance ID         | Name                             | State   | Image ID     | Platform     | Version | IP            | Status | Last pinged
i-03762678c45546813 | ssm-manager-manual-test-itsdalmo | running | ami-db1688a2 | Amazon Linux | 2.0     | 172.53.17.163 | Online | 2018-02-09 12:37
i-0d04464ff18b5db7d | ssm-manager-manual-test-itsdalmo | running | ami-db1688a2 | Amazon Linux | 2.0     | 172.53.20.172 | Online | 2018-02-09 12:39

$ vaulted -n lab-admin -- ssm-sh shell --target-file example.json
Initialized with targets: [i-03762678c45546813 i-0d04464ff18b5db7d]
Type 'exit' to exit. Use ctrl-c to abort running commands.

$ ps aux | grep agent
i-03762678c45546813 - Success:
root      3261  0.0  1.9 243560 19668 ?        Ssl  Jan27   4:29 /usr/bin/amazon-ssm-agent
root      9058  0.0  0.0   9152   936 ?        S    15:02   0:00 grep agent

i-0d04464ff18b5db7d - Success:
root      3245  0.0  1.9 317292 19876 ?        Ssl  Feb05   0:27 /usr/bin/amazon-ssm-agent
root      4893  0.0  0.0   9152   924 ?        S    15:02   0:00 grep agent

$ echo $HOSTNAME
i-03762678c45546813 - Success:
ip-172-53-17-163.eu-west-1.compute.internal

i-0d04464ff18b5db7d - Success:
ip-172-53-20-172.eu-west-1.compute.internal

Note

If you don't see any instances listed and still want to test ssm-sh, you can see the terraform/README.md for a quick way of setting up some test instances.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].