Sha256: 7464bb5de6f59f77dd16ae7b2be573d670485f7c972b5b6b957cb840cfa4a183

Contents?: true

Size: 1.59 KB

Versions: 10

Compression:

Stored size: 1.59 KB

Contents

# Remote Execution

RBCli can be configured to execute commands on a remote machine via SSH instead of locally.

Currently, only `script` and `extern` commands are supported.

## Configuration

To allow remote execution, go to `config/general.rb` and change the following line to `true`:

```ruby
remote_execution permitted: false
```

Then, for each command that you would like to enable remote execution for, add the following directive to the command class declaration:

```ruby
remote_permitted
```

## Usage

Your end users can now execute a command remotely by specifying the connection string and credentials on the command line as follows:

```bash
mytool --remote-exec [user@]host[:port] --identity (/path/to/private/ssh/key or password) <command>
# or
mytool -r [user@]host[:port] -i (/path/to/private/ssh/key or password) <command>
```

Some valid examples are:

```bash
mytool -r example.com -i myPassword showuserfiles -u MyUser
mytool -r root@server.local -i ~/.ssh/id_rsa update
mytool -r admin@172.16.0.1:2202 -i ~/.ssh/mykey cleartemp
```

If the end user is unsure of which commands can or can not be executed remotely, they can check by running `mytool -h`. Commands that have remote execution enabled will have an asterisk (*) by their name:

```bash
$ mytool -h
A simple command line tool.
For more information on individual commands, run `mytool <command> -h`.

Usage:
      foo [options] command [parameters]

Commands:
      bar                  TODO: Description goes here
   *  baz                  TODO: Description goes here

...
```

In this example, the command `baz` is available for remote execution

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
rbcli-0.2.11 docs-src/docs/advanced/remote_execution.md
rbcli-0.2.10 docs-src/docs/advanced/remote_execution.md
rbcli-0.2.9 docs-src/docs/advanced/remote_execution.md
rbcli-0.2.8 docs-src/docs/advanced/remote_execution.md
rbcli-0.2.7 docs-src/docs/advanced/remote_execution.md
rbcli-0.2.6 docs-src/docs/advanced/remote_execution.md
rbcli-0.2.5 docs-src/docs/advanced/remote_execution.md
rbcli-0.2.4 docs-src/docs/advanced/remote_execution.md
rbcli-0.2.2 docs-src/docs/advanced/remote_execution.md
rbcli-0.2.1 docs-src/docs/advanced/remote_execution.md