Who knew you could use React to build command line tools?!

Team Members

Launch Site


Manage your SSH configs with a CLI interface.

V800 screen shot


$ rssh --help

  Manage your SSH configs with a CLI interface.

    $ rssh <command> <options>

    init            Initialize the cli working directory.
    create host   Add hosts to your SSH config.
    create tunnel   Add local forward tunnels to your SSH config.
    list            Lists all hosts.
    show <host>     Show a specific host's information.
    connect         Connect to a configured tunnel.
    disconnect      Kill a tunnel connection that was created through the CLI.

    --help, -h      Display this message.
    --version, -v   CLI Version.

    $ rssh init
    $ rssh create host
    $ rssh create tunnel
    $ rssh connect
    $ rssh disconnect


npm install -g rssh

โš ๏ธ Initialize the tool's workspace

rssh init

Although it's a hackathon, we didn't want to be responsible for nuking your SSH config. All writes are made to the project's workspace. You'll probably get some errors about the directory not existing if you run any other commands.


  • Since it is a hackathon we didn't have time to implement editing the config file through the CLI.
  • If you make a mistake, you can blow your changes away by re-initializing the project (rssh init).
  • If you don't want to remove everything you can edit the SSH config directly which is located at ~/.bashnbastions-react-riot-2019/.ssh/config.
  • If you see cli referenced in the output that actually means rssh.
  • ๐Ÿงน This tunnel will run in the background until you disconnect them! Use rssh disconnect to close tunnels!
  • If you are setting up a tunnel you've never configured before you may need to accept the fingerprint outside of the application:
    • ssh -F ~/.bashnbastions-react-riot-2019/.ssh/config <tunnel-host>
  • If you want to see all the debugger logs you can enable it with an environment flag (DEBUG=* rssh <command>)

Future improvements

  • Allow you to edit/remove hosts and tunnels
  • Support all SSH configs
  • Better process management
  • Show tunnel status
  • Better configuration options
  • Better system support


In order to get the most out of this tool, it's important to understand what problem it aims to solve.

It's best practices to disconnect your network from the outside world. But what if you don't have physical access to that network? This is very typical when working with cloud service providers. A bastion server can be configured to act as a single entry point into that network, and can be configured to forward your requests to a computer inside the network.

If you ever had to configure an SSH tunnel, you probably already understand that there's a lot of configurations that need to be set up. and it can be difficult to maintain as you have more configurations added.

Local Forward Tunnel

Here's a great answer explaining the different types of tunnel configurations: https://unix.stackexchange.com/a/115906

This tool helps to set up this specific configuration.

in the end we end up running:

ssh -N <tunnel-host>

Which is the same as:

ssh -N -L <local-port>:<remote-hostname>:<remote-port> <bastion-hostname>

Exercise: Redirecting from one local port to another local port

This section outlines how to redirect traffic from localhost:8080 to localhost:3000.

You will need to make sure remote logins are enabled for your system:

  • Mac
  • Linux
  • Windows
    • This CLI relies entirely on the ssh command, so your mileage may vary!

Note: You haven't set up an SSH key before, please follow this awesome guide from GitHub! https://help.github.com/en/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent

๐ŸŽ—You will need to also make sure your public key (~/.ssh/id_rsa.pub in this case) is added to ~/.ssh/authorized_keys.

If you want to know more about SSH configurations, please see here for more information: https://www.ssh.com/ssh/config/

Add a host

rssh create host

We tried to keep it as simple as possible, but we will prompt you for the following configs:

  • Host: local-bastion
  • HostName: localhost
  • User <your-username>
  • Port 22
  • ForwardAgent yes
  • IdentityFile ~/.ssh/id_rsa

Add a tunnel

rssh create tunnel

At this point you should be able to select the host that we just created, local-bastion.

The main benefit of this tool is that you can set tunnels from existing hosts. So you just need to configure a host once, and you can create multiple tunnels from that.

We tried to keep it as simple as possible, but we will prompt you for the following configs:

Once a host is selected we will only prompt you for these configs - Host: 8080-to-3000 - Local Port: 8080 - Remote Host: localhost - Port: 3000

Start the tunnel

rssh connect

Select 8080-to-3000 and you're done!

Any traffic that would normally be served on port 3000 is now available to you on port 8080.

Closing the tunnel

rssh disconnect

Similar to the previous command, except this will close the tunnel.


Please open an issue: https://github.com/Hackbit/reactriot2019-bashinbastions/issues

Notes to the judges

Since we're deploying with the npm registry, installing the app will give you the latest version of the application.

Most of the core functionality was working before the entry cutoff period, so if you want to see the work that was done up until that point please use this branch:

Official Cuttoff:


We really enjoyed hacking on this and want to make sure the that what was published let people at least disconnect tunnels that were created via the CLI.

This is the running list of changes that have been made since the submission cutoff:

Changes since the official submission


Built With

Feedback / Ratings (4)

All Feedback