Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable ProxyCommand for one particular host?

Tags:

ssh

openssh

Using OpenSSH, I have set my /etc/ssh/ssh_config to have a ProxyCommand so all SSH connections go through that proxy.

/etc/ssh/ssh_config:

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

But I would like to disable the proxy for one particular SSH host.

I have added the following to my ~/.ssh/config:

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

What should I put with ProxyCommand so that it doesn't use a proxy for that particular host only, but the default is still to go through the proxy for SSH conncetions?

like image 290
Pierre Avatar asked Mar 11 '26 13:03

Pierre


1 Answers

The solution is to use ProxyCommand none for hosts that should go outside the proxy!

Host ssh.example.org
  HostName ssh.example.org
  ProxyCommand none
like image 184
Pierre Avatar answered Mar 15 '26 06:03

Pierre