惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

The Register - Security
The Register - Security
P
Privacy International News Feed
月光博客
月光博客
博客园 - 聂微东
Blog — PlanetScale
Blog — PlanetScale
V
Visual Studio Blog
Y
Y Combinator Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Google DeepMind News
Google DeepMind News
罗磊的独立博客
Vercel News
Vercel News
Last Week in AI
Last Week in AI
A
About on SuperTechFans
P
Proofpoint News Feed
M
MIT News - Artificial intelligence
人人都是产品经理
人人都是产品经理
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园_首页
T
Tailwind CSS Blog
GbyAI
GbyAI
S
Schneier on Security
L
LINUX DO - 热门话题
C
CERT Recently Published Vulnerability Notes
AWS News Blog
AWS News Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The Hacker News
The Hacker News
N
News and Events Feed by Topic
云风的 BLOG
云风的 BLOG
博客园 - 【当耐特】
C
Cybersecurity and Infrastructure Security Agency CISA
I
Intezer
V2EX - 技术
V2EX - 技术
The GitHub Blog
The GitHub Blog
Scott Helme
Scott Helme
V
V2EX
IT之家
IT之家
S
SegmentFault 最新的问题
爱范儿
爱范儿
L
LangChain Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
MongoDB | Blog
MongoDB | Blog
S
Security Affairs
Security Latest
Security Latest
T
The Blog of Author Tim Ferriss
P
Proofpoint News Feed
S
Secure Thoughts
MyScale Blog
MyScale Blog
F
Fortinet All Blogs
Hugging Face - Blog
Hugging Face - Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed

SSH

有没有能断线重连,并自动运行脚本的 SSH 工具? - V2EX 我不理解几乎所有 SSH 加固都提到配置公钥 - V2EX Mac 上找不到能替代 MobaXterm 的 SSH 工具,求推荐! - V2EX 为什么关了密码登录, auth.log 里还有账号密码登录错误的记录,难道不是直接断开吗? warp windows 版本出了 代理软件开启 tun 模式的时候 Termius 就没办法 ssh 了 - V2EX mosh ssh 问题 - V2EX 求一个 mac 下的 ssh 终端管理软件,刚需多开和广播输入 - V2EX Tabby 终于又可以云同步了,超级简单! - V2EX 通过 OSC 52 在 SSH 中调用本地 clipboard 有什么能很好管理 ssh 连接的工具吗 - V2EX 求助 请教一个 ssh 问题 - V2EX SSHD 配置问题 通过 frp 内网穿透 ssh 连接家里本子 - V2EX iTerm2 更新重启, session 居然不会断的?什么原理 - V2EX mac 的 SSH 连接可以套代理吗? - V2EX 求大佬指条路,提供一个能让学校服务器访问 hugging face 的手段 - V2EX 请教个的 ssh 连接不上的问题, SSH2_MSG_KEXINIT sent 后马上关闭了 - V2EX 有什么对 ssh 证书登录支持比较好的免费工具吗? - V2EX 1panel 自带的终端 当 web SSH 很好用,有单独 docker 版吗? - V2EX ssh 执行时$PATH 变量未替换 - V2EX 请问下 v 友们,用 ssh 连接国外服务器卡顿有什么解决方法吗? - V2EX 如何同步远程 SSH 机器粘贴板的内容 - V2EX wrap 终端要怎么保存 ssh 会话? - V2EX 求推荐 SSH 工具 - V2EX 有个疑惑,新机器连接服务器如何添加密钥?复制原来密钥? - V2EX 救一下,电脑连手机热点能连上 ssh,回家连 wifi 后就不行。 - V2EX 求推荐能保存密码的 ssh comand line tools - V2EX 22 端口无法使用 - V2EX 同一个 wifi 下,手机可以 ssh 顺利连上,电脑端却卡在连接中,求解惑 - V2EX iTerm2 中如何添加 CloudFlare Tunnel 的 SSH Profile - V2EX 公司电脑装了加密软件后, openssh 用不了了 - V2EX 如何配置~/.ssh/config 使得同一主机不同端口可以使用不同的策略登录 - V2EX wsl2 无法 ping 通网线连接的 ip - V2EX mobaxterm 是世界上最好用的 ssh 工具 - V2EX ssh chat - V2EX 桌面原生的 gui 程序嵌入命令行程序或者实现一个命令行控件,该从哪方面入手? - V2EX 如何禁止 ssh 走路由器 clash 流量 - V2EX 关于 ssh 命令下 t 参数 - V2EX 关于 ssh 日志/var/log/secure 的攻击日志 - V2EX 通过 frp 使用 ssh 连接终端总是一段时间就断开,有什么解决办法? - V2EX 两个可以互相访问的内网机器, A 能访问外网, B 不能,能通过设置 SSH 代理让 B 也能访问外网吗 - V2EX SSH 端口转发给我看迷糊了 - V2EX 由于经常换电脑,求推荐一个 windows 下轻量的 portable ssh 客户端,能够支持公钥登录 - V2EX V2EX V2EX 有没有这样的一个 ssh 命令行工具 - V2EX 遇到一个有趣的 ssh 的问题 - V2EX 下个月要外出,求可行的内网 SSH 方案 - V2EX
2024 年了, macOS 上最好用的 SSH 工具是啥? - V2EX
alanying · 2023-11-07 · via SSH

自己写的脚本,可以放在:/usr/local/bin/xxx
```
#!/bin/bash

# https://gist.github.com/pkuczynski/8665367
parse_yaml() {
local prefix=$2
local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034')
sed -ne "s|^\($s\)\($w\)$s:$s\"\(.*\)\"$s\$|\1$fs\2$fs\3|p" \
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 |
awk -F$fs '{
indent = length($1)/2;
vname[indent] = $2;
for (i in vname) {if (i > indent) {delete vname[i]}}
if (length($3) > 0) {
vn=""; for (i=0; i<indent; i++) {vn=(vn)(vname[i])("_")}
printf("%s%s%s=\"%s\"\n", "'$prefix'",vn, $2, $3);
}
}'
}

config_yml=$HOME/secret/server.yml

echo "欢迎使用快捷登录软件"

eval $(parse_yaml "${config_yml}" config_)

select server in $config_server; do
if [ ! -z "$server" ];then
break;
fi
done

# 都是一些默认值
port=config_${server}_port
port=${!port}
if [ -z "$port" ];then
port=22
fi

hostname=config_${server}_hostname
hostname=${!hostname}
if [ -z "$hostname" ];then
echo "不存在服务器配置,自动退出\n"
exit 0
fi

username=config_${server}_username
username=${!username}
if [ -z "$username" ];then
username=root
fi

password=config_${server}_password
password=${!password}

# 证书信息
pem=config_${server}_pem
pem=${!pem}

cmd="-o ServerAliveInterval=60 -p $port $username@$hostname"
if [ ! -z "$pem" ];then
cmd="-i ${pem} ${cmd}"
fi

# 跳板机
# ssh -J user1@host1:port1,user2@host2:port2 user3@host3:port3
proxy_jump=config_${server}_proxy_jump
proxy_jump=${!proxy_jump}
if [ ! -z "$proxy_jump" ]; then
cmd="-J ${proxy_jump} ${cmd}"
fi

# 加上 scp 前缀
cmd="ssh ${cmd}"

if [ ! -z "$password" ];then
cmd="sshpass -p ${password} ${cmd}"
fi

echo $cmd

eval $cmd
```
配置文件放在:$HOME/secret/server.yml
```
server name1 name2
name1:
hostname: 127.0.0.1
port: 22
username: root
password: 123456
pem: /path/to/xxx.pem
proxy_jump: 192.168.0.1:444
name2:
...
```