推荐一款 ssh 终端

2021-05-11 17:01:27 +08:00
 blueorange

需求 1 、敲一条命令, 这条命令能够分发到所有已经打开的窗口

9427 次点击
所在节点    DevOps
60 条回复
Tink
2021-05-11 17:05:19 +08:00
xshell
cheng6563
2021-05-11 17:10:30 +08:00
xshell5
saltbo
2021-05-11 17:18:47 +08:00
iterm2 cmd+shift+i
Xhack
2021-05-11 17:24:37 +08:00
xshell6
blueorange
2021-05-11 17:24:52 +08:00
谢谢各位了 我都去看看
syuraking
2021-05-11 17:26:31 +08:00
xshell5 和 6 都可以,7 真的难用
aaa5838769
2021-05-11 17:28:36 +08:00
xshell6
ice2016
2021-05-11 17:31:17 +08:00
xshell7
SecureCRT 7.1
landers2015
2021-05-11 17:32:34 +08:00
@saltbo 涨姿势了
0bit
2021-05-11 17:34:31 +08:00
感觉你是不是更想要 Ansible 之类的?
pakro888
2021-05-11 18:32:44 +08:00
xshell termius
blueorange
2021-05-11 18:43:35 +08:00
@0bit 感觉复杂了
Beebird
2021-05-11 19:17:14 +08:00
还可以在 tmux 中分割 pane,然后 setw synchronize-panes on,可以实现当前 windows 中的所有 pane 同步输入
codyfeng
2021-05-11 23:05:36 +08:00
@Beebird #13 原来还有这种操作,太 666 了。tmux 重度使用者表示感谢分享
ijrou
2021-05-12 01:12:28 +08:00
xshell
codingadog
2021-05-12 07:56:23 +08:00
mobaxterm
MeiJiayun
2021-05-12 08:26:05 +08:00
if windows
mobaxterm+1
archean
2021-05-12 08:29:18 +08:00
@saltbo 感谢分享,但如何取消这个状态呢?
liuliancao
2021-05-12 08:44:18 +08:00
#!/usr/bin/env bash
# usage: ssh-multi for tmux by liuliancao at 2021/04/22 v1.
# a script to ssh multiple servers over multiple tmux panes
while getopts p:u:f: OPTION
do
case $OPTION in
p)PORT=$OPTARG;;
u)USER=$OPTARG;;
f)FILE=$OPTARG;;
?)echo "use ssh-multi -p $PORT -u $USER -f ssh-hosts-file" && exit 1;;
esac
done
index=-1

# split window to ssh
cat $FILE | while read host; do
index=$(($index + 1))
#if in tmux
if [[ -z $TMUX ]];then
in_tmux=0
[[ $index -eq 0 ]] && tmux new-session -d "ssh -p $PORT $USER@$host" && continue
tmux split-window -h "ssh -p $PORT $USER@$host"
# if not
else
in_tmux=1
[[ $index -eq 0 ]] && tmux new-window -n "ssh-multi" "ssh -p $PORT $USER@$host" && continue
tmux split-window -t "ssh-multi" "ssh -p $PORT $USER@$host"
fi
tmux select-layout tiled
done

tmux set-window-option synchronize-panes on

[[ in_tmux -eq 0 ]] && tmux a
yalin
2021-05-12 08:57:50 +08:00
SecureCRT

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/776285

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX