Giter Club home page Giter Club logo

tmssh's Introduction

tmssh

tmux的增强工具,用于批量ssh远程主机(类似windows下xshell这类软件批量打开远程终端),适用于操作多服务器的运维们。

特性:

  • 配合tmux使用,在tmux中批量远程服务器(类xshell软件的多标签窗口)。
  • 支持使用命令的分组和IP地址自动补全。
  • 纯bash工具,安装和配置简单。

install

tmssh工具包安装:

git clone https://github.com/Vastxiao/tmssh /usr/local/tmssh

config

tmssh环境配置很简单,仅需要在 bash 环境中加载 bash_env_load.sh 环境配置:

# 可以在 ~/.bashrc ~/.zshrc 等加载这个内容

# 如果出现 complete: command not found 错误,就加载以下两行:
#autoload bashcompinit
#bashcompinit
export TMSSH_HOME=/usr/local/tmssh
source ${TMSSH_HOME%/}/etc/bash_env_load.sh

# 另外[可选项]可以指定默认的ssh用户名
export TMSSH_SSH_USER=root

接着就是编辑hosts文件信息了,相关的hosts文件模板是hosts.txt.template:

cp ${TMSSH_HOME%/}/etc/hosts.txt.template ${TMSSH_HOME%/}/etc/hosts.txt
vim ${TMSSH_HOME%/}/etc/hosts.txt

配置完成后就可以使用tmssh了。

usage

tmssh 的命令帮助:

help usage:

  tmssh -h         Show this message.
  tmssh -v         Report the tmssh version.

  tmssh -l         Show all groups.
  tmssh -l group_name
                   Show hosts in group.
  tmssh -e         Edit hosts.

  tmssh [-Auis] group_name
                   Connect to a group
  tmssh [-Anpuiw] group_name host_id
                   Connect to a host
  options:
     -A            Enables forwarding of the authentication agent connection.
     -n <1-9>      Use specified ip to connect to the remote host if possible.
     -p port       Port to connect to on the remote host.
     -u username   Login whith this username.
     -i identity_file
                   Selects a file from which the identity (private key) for public key authentication is read.
     -s tmux_session_name
                   Use tmux_session_name on tmux instead of group_name.
     -w tmux_window_name
                   Use tmux_window_name on tmux instead of ip.

tmssh's People

Contributors

vastxiao avatar

Stargazers

 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.