I have the following lines in my .ssh/config
:
Host localhost
ProxyCommand none
Host n0*
ProxyCommand none
Host *
ProxyCommand corkscrew proxy.m.com 80 myserv 443 ~/.ssh/auth
i.e. for localhost
and n0*
ssh will not use the proxy, but for other hosts it will.
I got trapped several times know when I wanted to connect to other local machines, but couldn't connect because the proxy was active. There was no exception for them in ~/.ssh/config
.
Is there away to echo an information to the command line, when the proxy is used? e.g.
$ ssh otherpc
---> using ProxyCommand corkscrew proxy.m.com 80 myserv 443 ~/.ssh/auth
Password:
I know that ssh -v
is listing this line (along with many others):
debug1: Executing proxy command: exec corkscrew proxy.m.com 80 myserv 443 ~/.ssh/auth
Is there less verbose way of displaying the proxy command used, helping me to avoid being trapped? Maybe a clever bash alias/function grepping ssh -v
?
Warning: Don't write ssh() { ssh -v | grep Proxy}
. I tried that too ... and accidently fork bombed me :P