小编Jos*_*orn的帖子

使用 ProxyCommand 和 netcat 模式时,让 ssh 从配置中解析主机名

我正在尝试为弹跳 ssh 连接设置一些通用选项。这是我的~/.ssh/config文件,缩写:

Host *%via
  ProxyCommand ssh gateway -W $(echo %h | cut -d%% -f1) %p

Host gateway
  HostName gateway.example.com
  User username
  ForwardAgent yes
  IdentityFile keypathg

Host target
  User username
  HostName target.example.com
  IdentityFile keypatht
Run Code Online (Sandbox Code Playgroud)

当我利用*%via利用Host别名,我得到:

% ssh -vvv target%via
OpenSSH_5.9p1, OpenSSL 0.9.8y 5 Feb 2013
debug1: Reading configuration data /Users/myuser/.ssh/config
debug1: /Users/myuser/.ssh/config line 5: Applying options for *
debug1: /Users/myuser/.ssh/config line 12: Applying options for *%via
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line …
Run Code Online (Sandbox Code Playgroud)

ssh proxy

16
推荐指数
1
解决办法
1万
查看次数

标签 统计

proxy ×1

ssh ×1