bastion-cli (0.7.7)

ptdorf
2016-04-08T22:23:36Z

# bastion-cli

Log into things through bastions.

[![Build Status](https://travis-ci.org/ptdorf/bastion-cli.svg?branch=master)](https://travis-ci.org/ptdorf/bastion-cli)
[![Gem Version](https://badge.fury.io/rb/bastion-cli.svg)](https://badge.fury.io/rb/bastion-cli)

## Installation

```shell
sudo gem install bastion-cli
```

## Usage

```shell
# To see all options
$ bastion
Commands:
bastion help [COMMAND] # Describe available commands or one specific command
bastion host [HOST] # Show or set the default bastion host
bastion ssh [INSTANCE] # Logs into an instance
bastion tunnel [PORT] # Starts a new tunnel
bastion version # Shows current version

# To log into an instance
$ bastion ssh 10.1.2.3

# To log into an instance specifying a bastion host
$ bastion ssh 10.1.2.3 --host 12.34.56.78

# To log into an instance specifying a bastion host and make it default
$ bastion ssh 10.1.2.3 --host 12.34.56.78 --save

# To show the default bastion host
$ bastion host

# To set the default bastion host
$ bastion host bastion.example.com

# To open a tunnel using the default bastion host
$ bastion tunnel

# To open a tunnel using the default bastion host on port 1337
$ bastion tunnel 1337 --host 12.34.56.78
```

You can also set the `BASTION_HOST` environment variable with the address of the
bastion host:

BASTION_HOST=bastion.example.com bastion ssh web.example.com

The pecking order is:

- `BASTION_HOST` environment variable
- The default value that lives in `${HOME}/.bastion`