A tmux-based SSH/Telnet Client for Managing Many-hosts
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 tmuxin Ubuntu, or
brew install tmuxin Mac OS X.
The modules pexpect, toml and pypinyin should be installed first via:
pip install pexpect pypinyin tomlAn application that can handle the "ftp://" urls should be installed. If you do not use ftp, this can be ignored.
git clone https://github.com/Tefx/Mcx.git-
Copy the sample configurations to
/etc/mcxor~/.mcx:cp -r Mcx/conn_sample ~/.mcx -
Change the ftp url handler by setting the value of
ftp_toolin$CONF_PATH/config.json.
- You can easily set it to
xdg-openfor Linux oropenfor Mac OS X. - You can alternatively set it to
filezillaor any other specific app, as long as it can handle the urlftp://user:password@ip.
- Put you host configurations inside
$CONF_PATH/hostsfolder.
- Have a Look at the sample host configurations. It should be self-explanatory.
conn_typeshould be eithersshortelnet.auth_typeshould be eitherpasswordorkey. If the value ispassword, the variablepasswordmust be set. If the value iskey, an optional variablepassphrasemight be needed at the same time.- The sub-folders and any number of configuration files are acceptable. The
hostsfolder will be scanned recursively for all hosts.
cd Mcx;tmux -f tmux.source| 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-paneand 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:bjbj/cshbj/cs/1new/Serceshi/1- And many other patterns. Try out by yourselves.
- The Prefix should be Ctrl-B by default in