Code Monkey home page Code Monkey logo

ssh2's Introduction

SSH to Your EC2 Instance Instantly

SSH2 is an interactive command line tool which allows you to quickly ssh to an EC2 instance. You can select from a list of running servers under your account.

Usage

$ ssh2 1
$ ssh2 -h
Usage: ssh2 [options] [server_number]
  server_number: a numeric value corresponding to the server number
  e.g.: 'ssh2 1' will ssh into the 1st server in the list.

Options:
  -h, --help            show this help message and exit
  -x, --bust-cache      refetch servers list from AWS
  -u USER, --user=USER  provide user (default: ubuntu)
  -i IDENTITY, --identity=IDENTITY
                        provide identity file
  -p PROFILE, --profile=PROFILE
                        provide AWS profile
  --ip=IP               connect using IP instead of DNS
  -g GREP, --grep=GREP  filter the server list

Filtering the list by EC2 instance name

$ ssh2 -g webrt

Servers list:

[1]  ec2-XX-XX-XX-XX.us-west-2.compute.amazonaws.com       webrtc-kurento

Which server would you like to connect to [1]? 

$ ssh2 -g webrt 1

Connecting to webrtc-kurento ec2-XX-XX-XX-XX.us-west-2.compute.amazonaws.com

Requirements

Installation

pip install ssh2

or

without using Python package manager:

git clone https://github.com/soheil/ssh2.git
cd ssh2
ln -sf $(pwd)/ssh2 /usr/local/bin/

Author

Soheil Yasrebi, @soheil

ssh2's People

Contributors

durzo avatar mariusv avatar matthiasamberg avatar prakhar1989 avatar soheil avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ssh2's Issues

Connect over VPC configuration

Hi,

I like your tool, thanks for it.

We've been looking for a handy EC2-node client and this is quite cool for public nodes. However, nodes that are inside a VPC - which can only be reached through an entry node - are not reachable and cause the tool to ssh to an empty hostname.

-----Internet-----   --------VPC--------
                     |                 |
    [dev]  --->   [ENTRY]  --->  [node]|
                     |                 |
                     -------------------

We're usually connecting through a default rule into the VPC:

Host <Subnet inside VPC>.*
   User ...
   ProxyCommand ssh <entrynode> "nc %h %p"
   IdentityFile ...

Is it somehow possible to realize behavior like this with this tool?

Thanks & ๐Ÿป

ssh2 & python3 issues

anyone else having issues trying to run ssh2 when using python3?

i get these which i have fixed manually
SyntaxError: Missing parentheses in call to 'print'.()

it it also dosnt like exit() on line 77
SyntaxError: invalid syntax

Feature Request: Ability to add favorites

It would be nice if we can add few servers as favorites and list them down as say ssh2 -f. I currently have more than 20 servers running so I assuming many people have more than 10 instances running in their account and favorites will help.

Let me know if you have this in the pipeline.. else i can submit a PR.

ValueError: No JSON object could be decoded

I'm running Python 2.7.8 on OSX 10.11.1 and get the following error:

Nilays-Retina-MacBook-Pro:ssh2 Nilay$ ssh2
Traceback (most recent call last):
  File "/usr/local/bin/ssh2", line 42, in <module>
    parsed = json.loads(output)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 338, in loads
    return _default_decoder.decode(s)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 366, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 384, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

update version to pypi

Currently an older version is on pypi and the grep option isn't available. Can you update?

Thanks,
Aleck

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.