Adicionando uma exceção ao ProxyCommand no arquivo de configuração ssh

1

Como adicionar um ProxyCommand a todos os hosts ssh, exceto abc.com

Eu tentei as seguintes linhas no arquivo ~/.ssh/config , mas não funciona.

    Host *
      ProxyCommand nc -X connect -x proxy.com:8080 %h %p

    Host abc.com
      ProxyCommand NULL

Qualquer ajuda seria apreciada.

    
por Krishna 28.01.2014 / 13:55

1 resposta

1

De acordo com a página man do Ubuntu para ~ / .ssh / config :

Host

......

A pattern entry may be negated by prefixing it with an exclamation mark ('!'). If a negated entry is matched, then the Host entry is ignored, regardless of whether any other patterns on the line match. Negated matches are therefore useful to provide exceptions for wildcard matches.

Assim, seu problema pode ser resolvido da seguinte forma:

Host !abc.com

ProxyCommand nc -X connect -x proxy.com:8080 %h %p

    
por 28.01.2014 / 14:58

Tags