Giter Club home page Giter Club logo

sshto's Introduction

sshto

Small bash script that builds a menu (via dialog) from your ~/.ssh/config.
screeenshot
Allows you to connect to your servers or run commands from menu. Available commands:
screeenshot
Your commands can be easily added to this list. Just edit this part of the script:

cmdlist_renew () { cmdlist=(
    #Command#  #Description#
    "Username" "Change ssh username to $GUEST"
    ''         ''
    "ls  -la"  "List Files"
    "free -h"  "Show free memory"
    "df  -ih"  "Show free inodes"
    "df   -h"  "Show free disk space"
    "Custom"   "Run custom command on $target"
    ''         ''
    "Info"     "Full system info"
    "Sshkey"   "Add my ssh key to $target"
    "Alias"    "Add my usefull aliases to $target"
    "Copy"     "Copy selected file or dir to $target"
    ''         ''
    "Dest"     "Change destination folder $DEST on $target"
    "Upload"   "Upload   file or folder from $PWD to $target:$DEST"
    "Download" "Download file or folder from $target:$DEST to $PWD"
    ''         ''
    "Local"    "Change local  port $LOCAL"
    "Remote"   "Change remote port $REMOTE"
    "Tunnel"   "Start portunneling from $target port $REMOTE to local port $LOCAL"
    ''         ''
    "ShowConf" "Show ssh config for this host"
    "EditConf" "Edit ssh config for this host"
); }

First collumn - command, second - description.
Simple commands like 'ls -la' can be added as is.
A list of commands or a complicated logic better add via function.
Empty string is used as a delimiter.
You can quick jump to the selected server via CONNECT button.
When you done press ^D it'll bring you back to sshto commands section.

Hosts description needs to be added like this:

Host server1 #DESCRIPTION
HostName 192.168.0.1
Port 22
User admin

Start menu delimiters '---{ TEXT }---' can be added like this:

#Host DUMMY #TEXT#

~/.ssh/config example:

#Host DUMMY #Rybinsk#

Host rybserver1 #First server
HostName localhost

Host rybserver2 #Second server
HostName localhost

Host rybserver3 #Third server
HostName localhost

#Host DUMMY #Moscow#

Host moserver1 #First server
HostName localhost

Host moserver2 #Second server
HostName localhost

Host moserver3 #Third server
HostName localhost

Script greps data from multiple config files via pattername 'config*' in ~/.ssh dir.
So you can split config to multiple files and use them with Include directive, example:

Include config_moscow
Include config_rybinsk
Include config*

You can customize dialog colors by creating a config file:

dialog --create-rc ~/.dialogrc

How to install

Clone\download this project, go to it's folder and run:

sudo cp sshto /usr/bin/

#and to unistall
sudo rm /usr/bin/sshto

See how it works at asciinema

ssh config guide
Tom Lawrens video guide about ssh config and sshto

paypal Feel free to support the project!)

BTC: 1LxRxsyXP389YW3Ezw9YzNetE5VYj1RaJf
btc

BCH: qqnssal30x6acrga6zt4pd4q2s2t8um3cyqvd37qs7
bch

ETH: 0xd7e17A37DD936B211790ba70Aa985448277030E8
eth

XMR: 484z9YpiD4VBd4BfsaG7jKGYGuJ84tYJyCJBX4ZnAPqQXsUWgTY14TKRH3JLosFSAsKsv75nyt9yWPkFMUJhryxi7zccHNB
mon

LTC: LRVPYR7dvRVdNET23gg3fvTwDM9hotQkZw
ltc

DASH: Xtz7P6GasicE9yS8zXkH3PH2qAF2qWJADG
dash

ZEC: t1ZDgHci8yDVkoGvUFG7QtxUNRuzsF1Qtse
zec

MKR: 0xd7e17A37DD936B211790ba70Aa985448277030E8
mkr

sshto's People

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.