如何为一台特定主机禁用ProxyCommand?

问题描述 投票:0回答:1

使用OpenSSH,我已将/etc/ssh/ssh_config设置为具有ProxyCommand,因此所有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连接使用代理?

ssh openssh
1个回答
0
投票

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

Host ssh.example.org
  HostName ssh.example.org
  ProxyCommand none
© www.soinside.com 2019 - 2024. All rights reserved.