ssh-bot

23550603_834202376757247_4960199550523408384_n

This is not a common Bot, is not going to respond you to a hello or give you the weather... This Bot is for the Ninja Developer, the one that can solve problems with his utility belt. This Bot is the utility belt he need.

Description

A Facebook Messenger Chat Bot that is going to allow you to connect through SSH into your server.

This is what we support:

  • PEM connections (YES, you can use your Private Key)
  • Password Connections
  • String responses - The result of a command thrown
  • Image responses - The result of a command on a image, like you are seeing the Terminal! # How-it-works (Messenger)

These are the available commands you can use with our utility belt bot:

  • ssh -> Connect to your server
  • cmd -> Send commands
  • reconnect -> Connect to previous ssh connection
  • disconnect -> Close connection
  • help -> Show all the commands

Usage

Next, we are going to explain all the commands on more detail

ssh

You can use this command to connect to your server. We support the next arguments:

  • host
  • user
  • password
  • port: Default 22
  • pem: Just add it, no values

If you want to start a connection with a server with a password

ssh --host 127.0.0.1 --user root --password root

If you want to use a PEM, you need to send it to use first. Don't worry!, your information is secure:

screen shot 2017-11-16 at 16 55 55

When you receive the acknowledge text, you are able to connect using the PEM file

ssh --host 127.0.0.1 --user root --pem

cmd

This command would allow you to send commands (of course) to your server.

Remember, this is not an interactive console. You are not going to have good responses if you send a --tail command"

We support the next arguments:

  • --image: Just add it, no values
  • --interactive: Just add it, no values

Example:

cmd pwd

screen shot 2017-11-16 at 17 02 06

--image

Yes!, you here right. If you send the --image parameter you will recive the ouput on an image like your are seeing the terminal:

Example:

cmd ls -la

screen shot 2017-11-16 at 17 24 26

Yes, you can click and ZOOM IN

--interactive

Lots of Linux servers if you are not running interactive, the .bashrc file will exit early. So? If that happends, there are many commands that you are going to lose. So, if you send --interactive, your command is going to work like a charm

Example:

cmd npm --version --interactive

screen shot 2017-11-16 at 17 26 31

reconnect

If you already login, you dont need to send the command of ssh again. You can just reconnect

reconnect

disconnect

Just type disconnect to close your open connection

disconenct

help

If you need help with the commands, you can just type help

help

Technical Spoilers

Just read the code, don't be lazy. Just kidding. This application was done using NodeJS. This are the main packages that we are using:

To upload the attachments we are manually doing the request.

Built With

Share this project:

Updates