我正在尝试为弹跳 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)