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

标签 ssh openssh

使用 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 连接?

最佳答案

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

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

关于ssh - 如何为一台特定主机禁用 ProxyCommand?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62015729/

相关文章:

ssh - Windows 终端主题颜色 SSH

使用 Dockerfile/go.mod 文件的私有(private)存储库的 Go 构建失败

macos - 无密码 SSH 登录

shell - 从文本文件中删除重复的行

ssh - 在服务器上设置SSHv1

windows - Ansible无法通过SSH连接到Windows节点

linux - centos6.5中的HostKey算法

encryption - 客户端和服务器之间的 ssh : How does server decrypt the data send by client to it?

windows - 在使用 native OpenSSH 的 ssh-agent 配置良好的 Windows 10 上,如何让 git 的实现使用配置的 ssh-agent?

java - com.jcraft.jsch.JSchException : remote port forwarding failed for listen port 19999