Giter Club home page Giter Club logo

cod-shell's Introduction

COD Shell

COD is a simple SSH CLI utility. It assists in saving SSH connection settings to an INI file so they can be loaded and connected to easily.

Additionally, it understands how to connect to AWS and other cloud-hosted servers by name so those don't have to be setup individually. This is especially helpful for things like AWS EMR job clusters where the instances are created on the fly and all you have handy is a cluster ID.

It requires Python 3.7+.

Setup

Clone the repository from GitHub:

$ git clone https://github.com/massung/cod-shell.git

Change directories to the cod-shell directory and install it using setuptools:

$ python setup.py install

Creating an SSH Connection

Once setup, you can add connections using cod add from the command line:

$ cod add my-server
host:
port [22]:
login [none]:
key [none]:
agent forwarding [false]:

The host name/IP is required, but all the others are optional. If no login is provided then you will be prompted for a username upon trying to connect. If no key is provided, then you will be prompted for a password as well.

NOTE: The key should be a name and not a file as multiple hosts can all use the same key. When you attempt to connect to a server that requires a key COD doesn't know about, it will ask you to locate the SSH key (PEM file) on disk and will save a reference to it for future use.

Connecting to a Server

Use the cod sh command to connect to a server you have set up:

$ cod sh my-server

At this point, if you specified a key name for the connection, COD will ask you to locate it for use. This will only happen once for each key.

Connecting to a Cloud Instance

You don't need to add cloud servers. As long as you have the cloud service installed on your machine (e.g. awscli for AWS), you can just reference the cloud instance by name and provide a flag to COD indicating it is a cloud instance. For example:

$ cod sh my-ec2-instance --aws

This will tell COD that my-ec2-instance is an AWS instance. It will then connect to AWS using the credentials you have already configured on your machine to look up the instance name, get its IP address and any SSH key required to connect to it. To look up the instance, it first checks to see if the instance name is an instance id beginning with i- or a job flow ID beginning with j-. Otherwise it assumes the name provided matches the Name tag of the EC2 instance.

NOTE: Right now there is only support for AWS, but GCP and Azure should be easy to add.

cod-shell's People

Contributors

massung avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

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.