Skip to content

Tefx/Mcx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mcx

A tmux-based SSH/Telnet Client for Managing Many-hosts


Get Started

Prerequisites

tmux

Since Mcx is tmux-based, you must use your system's package manager to install the tmux first. For example, you can use

apt-get install tmux

in Ubuntu, or

brew install tmux

in Mac OS X.

Python modules:

The modules pexpect, toml and pypinyin should be installed first via:

pip install pexpect pypinyin toml

Ftp client

An application that can handle the "ftp:https://" urls should be installed. If you do not use ftp, this can be ignored.

Basic Installation

Clone this repository

git clone https://github.com/Tefx/Mcx.git

Configuration

  1. Copy the sample configurations to /etc/mcx or ~/.mcx:

    cp -r Mcx/conn_sample ~/.mcx
  2. Change the ftp url handler by setting the value offtp_tool in $CONF_PATH/config.json.

  • You can easily set it to xdg-open for Linux or open for Mac OS X.
  • You can alternatively set it to filezilla or any other specific app, as long as it can handle the url ftp:https://user:password@ip.
  1. Put you host configurations inside $CONF_PATH/hosts folder.
  • Have a Look at the sample host configurations. It should be self-explanatory.
  • conn_type should be either ssh or telnet.
  • auth_type should be either password or key. If the value is password, the variable password must be set. If the value is key, an optional variable passphrase might be needed at the same time.
  • The sub-folders and any number of configuration files are acceptable. The hosts folder will be scanned recursively for all hosts.

Usages

Launch

cd Mcx;tmux -f tmux.source

Keymap

Keybinding Description
Prefix S search hosts by name.
Prefix F open ftp application and connect to the current host.
Prefix V open a vertically splited pane and connect to the same host.
Prefix v open a horizontally splited pane and connect to the same host.
Prefix C view all connected hosts. I call this listing pane as host-listing-pane.
d kill connections to the selected hosts. Works only in the hast-listing-pane.
  • Notes:
    • The Prefix should be Ctrl-B by default in tmux.
    • Using Prefix S to connect a host which is already have connections in other window is considered as connecting a new host. The different windows connected to the same host are shown as several hosts in the host-listing-pane and can be killed individually.
    • All other tmux-shortcuts should be usable as usual.
    • In searching, the patterns can be full Pinyin, Pinyin Initials, Pinyin first-letters or substrings. / is used for splitting different levels. For example, "北京/new/测试MySQL/Server1" can be matched by:
      • bj
      • bj/csh
      • bj/cs/1
      • new/Ser
      • ceshi/1
      • And many other patterns. Try out by yourselves.

About

A tmux-based SSH/Telnet Client for Managing Many-hosts

Resources

License

Stars

Watchers

Forks

Packages

No packages published