首页 > 解决方案 > 如何为一台特定主机禁用 ProxyCommand?

问题描述

使用 OpenSSH,我设置了我/etc/ssh/ssh_configProxyCommand所有 SSH 连接都通过该代理。

/etc/ssh/ssh_config

Host *
  ProxyCommand nc -X connect -x localhost:8111 %h %p

但我想禁用一个特定 SSH 主机的代理。

我已将以下内容添加到我的~/.ssh/config

Host ssh.example.org
  HostName ssh.example.org
  ProxyCommand ""

我应该放什么,ProxyCommand这样它就不会只为该特定主机使用代理,但默认仍然是通过代理进行 SSH 连接?

标签: sshopenssh

解决方案


解决方案是ProxyCommand none用于应该在代理之外的主机!

Host ssh.example.org
  HostName ssh.example.org
  ProxyCommand none

推荐阅读