Giter Site home page Giter Site logo

sshmate's Introduction

sshmate

sshmate is a tool designed to simplify interactions with SSH servers. It provides an easy way to connect to servers by assigning a name to an address. After adding a connection, you can directly connect to the server using the name you provided. It also allows adding log messages to existing connections. These log messages serve as additional descriptions of the server, making it easier to remember what the server is for and how it's been changed over time. For example, you might add log messages like upgraded mysql or installed nginx using latest version. Then, when you need to connect to the server again, you can simply search for keywords in the log messages to quickly find the server you need.

sshmate also supports symbolic links, which means that sshmate can be installed at any path. sshmate includes an autocompletion feature that makes it easy to quickly navigate between connction names using the tab key.

image

Installation

You need to clone the repo and cd in the root folder sshmate before proceeding further. This can be done by running the following:

git clone https://github.com/lrwx00t/sshmate
cd sshmate

Using Makefile

make install

Manual Installation

  • Create a symlink to sshmate script
    ln -s {REPO_PATH}/sshmate /usr/local/bin/sshmate
  • Install the auto-completion script e.g. in your ~/.zshrc:
    source {REPO_PATH}/sshmate-completion.bash

Usage

❯ sshmate -h
Usage:   sshmate -c <NAME>                 (connect to an existing connection)
         sshmate -l                        (list all connections)
         sshmate -n <NAME> -a <ADDRESS>    (add a new connection)
         sshmate -a <NAME> -d <MESSAGE>    (add a log message to an existing
                                           connection)
         sshmate -s <TXT>                  (connection to an existing connection
                                           by a matching text in the log)
         sshmate -r <NAME>                 (remove connection)
Options:
         -c <CONNECTION_NAME>      (connect to an existing connection name)
         -l                        (list all connections)
         -n <CONNECTION_NAME>      (add a new connection name)
         -a <CONNECTION_ADDRESS>   (add a connection address, used with -n)
         -d <MSG>                  (add a log message to an existing connection)
         -r <CONNECTION_NAME>      (remove an existing connection)
         -s <TXT>                  (connect to a machine using an existing
                                    connection by finding match in the logs)
         -h                        (show this message for usage help)

Example: Connect to an existing connection name
         sshmate -c do_linux_centos7

         Create a new connection
         sshmate -n do_linux_centos7 -a [email protected]

         Create a new connection
         sshmate -a do_linux_centos7 -d "installed mysql latest version"

         Connect to an existing connection by searching for a match in the logs
         sshmate -s mysql

Examples

Add a new connection

❯ sshmate -n do_linux_ubuntu16 -a [email protected]
adding new connection..
Adding [[email protected]] connection with the name: do_linux_ubuntu16%

List all connections

❯ sshmate -l
listing all SSH connections...
do_linux_centos7                 ==>  [email protected]
do_linux_ubuntu16                ==>  [email protected]
do_linux_rh                      ==>  [email protected]

Connect to one of the listed/existing connections

❯ sshmate -c do_linux_centos7
checking connection:do_linux_centos7
connecting to: [email protected]
ssh [email protected]

Add/append a log message to an existing connection

❯ sshmate -a do_linux_centos7 -d "installed mysql with new test db"
adding new connection..
add a description to existing connection
description is:  installed mysql with new test db
got connection:  do_linux_centos7

Use a log message lookup to access an existing connection

❯ sshmate -s mysql
connecting to: [email protected]

sshmate's People

Contributors

lrwx00t avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.