项目作者: buger

项目描述 :
云增强了SSH客户端替换与主机自动完成
高级语言: Go
项目地址: git://github.com/buger/cloud-ssh.git
创建时间: 2014-03-10T10:59:59Z
项目社区:https://github.com/buger/cloud-ssh

开源协议:

下载


cloud-ssh

Cloud enhanced SSH client replacement with host auto-completion.

In times of digital clouds, servers come and go, and you barely remember its names and addresses. This tiny tool provide fuzzy search (yeah like SublimeText) for your instances list, based on tags, security groups and names.

Official site: https://buger.github.io/cloud-ssh/

Installation

Automatic installation. Just run following code in your terminal

  1. bash <(curl -# https://buger.github.io/cloud-ssh/install.sh)

Manual installation - download and unpack latest release: http://github.com/buger/cloud-ssh/releases

Examples

  1. sh-3.2$ # Lets say i want connect to server called stage-matching
  2. sh-3.2$ ./cloud-ssh leon@stama
  3. Found config: /Users/buger/.ssh/cloud-ssh.yaml
  4. Found clound instance:
  5. Cloud: granify_ec2 Matched by: aws:autoscaling:groupName=stage-matching Addr: ec2-50-200-40-200.compute-1.amazonaws.com
  6. Welcome to Ubuntu 12.04 LTS (GNU/Linux 3.2.0-25-virtual x86_64)

If there are more then 1 server matching your query, it will ask you to choose one:

  1. sh-3.2$ # I want to check one of my CouchBase servers
  2. sh-3.2$ ./cloud-ssh ubuntu@couch
  3. Found config: /Users/buger/.ssh/cloud-ssh.yaml
  4. Found multiple instances:
  5. 1) Cloud: granify_ec2 Matched by: Name=couchbase-02 Addr: ec2-50-200-40-201.compute-1.amazonaws.com
  6. 2) Cloud: granify_ec2 Matched by: Name=couchbase-03 Addr: ec2-50-200-40-202.compute-1.amazonaws.com
  7. 3) Cloud: granify_ec2 Matched by: Name=couchbase-04 Addr: ec2-50-200-40-203.compute-1.amazonaws.com
  8. 4) Cloud: granify_ec2 Matched by: Name=couchbase-01 Addr: ec2-50-200-40-204.compute-1.amazonaws.com
  9. 5) Cloud: granify_ec2 Matched by: Name=couchbase-05 Addr: ec2-50-200-40-205.compute-1.amazonaws.com
  10. Choose instance: 1
  11. Welcome to Ubuntu 12.04.4 LTS (GNU/Linux 3.2.0-58-virtual x86_64)

Nice, right? More over, cloud-ssh can act as full ssh replacement, since it just forward all calls to ssh command.

Configuration

By default it checks your environment for AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables. If you want advanced configuration you can create cloud-ssh.yaml in one of this directories: ./ (current), ~/.ssh/, /etc/

Note that you can define multiple clouds, per provider, if you have multi-datacenter setup or just different clients. Cloud name will be included into search term, so you can filter by it too!

Right now only 2 data cloud providers supported: Amazon EC2 and DigitalOcean.

Example configuration:

  1. gran_ec2: # cloud name, used when searching
  2. provider: aws
  3. region: us-east-1
  4. access_key: AAAAAAAAAAAAAAAAA
  5. secret_key: BBBBBBBBBBBBBBBBBBBBBBBBB
  6. default_user: ubuntu
  7. gran_digital:
  8. provider: digital_ocean
  9. client_id: 111111111111111111
  10. api_key: 22222222222222222

Faq

Can it be drop-in replacement for SSH?

Totally yes! Actually it just SSH wrapper, so all SSH command options will work as before.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am ‘Added some feature’)
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request