I am trying to set up connection to [email protected] via powershell terminal (with config located in .ssh\config) without proxy, however, I want to keep being able to connect to all other pp servers with my admin user and to retain internal.pp.com behind a proxy
My ssh config goes as follows:
Host pp-d1*
User ubuntu
Port 22
IdentityFile ~\.ssh\mykey
SendEnv LS_*
SendEnv TERM=screen
ForwardAgent yes
Host pp-*
User admin
Port 22
IdentityFile ~\.ssh\mykey
SendEnv LS_*
SendEnv TERM=screen
ForwardAgent yes
Host *old-kernel.com *internal.pp.com
User ubuntu
Port 22
IdentityFile ~\.ssh\mykey
SendEnv LS_*
SendEnv TERM=screen
ForwardAgent yes
ProxyCommand ssh proxy.internal.pp.com nc %h %p 2> /dev/null
The issue is that technically I should get a match on rule 1 but for some reason I get a match on rule 1 and 3 and number 3 prevails and it wants to push me through the proxy.
Below the ssh debug:
PS C:\Users\peter> ssh pp-d1-gritz.pp.internal.com -vvv
OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2
debug1: Reading configuration data C:\\Users\\peter/.ssh/config
debug1: C:\\Users\\peter/.ssh/config line 3: Applying options for pp-d1*
debug1: C:\\Users\\peter/.ssh/config line 11: Applying options for pp-*
debug2: add_identity_file: ignoring duplicate key C:\\Users\\peter\\.ssh\\mykey
debug1: C:\\Users\\peter/.ssh/config line 19: Applying options for *pp.internal.com
debug2: add_identity_file: ignoring duplicate key C:\\Users\\peter\\.ssh\\mykey
debug3: Failed to open file:C:/ProgramData/ssh/ssh_config error:2
debug1: Executing proxy command: exec ssh proxy.internal.pp.com nc pp-d1-gritz.pp.internal.com 22 2> /dev/null
debug3: spawning "ssh proxy.internal.pp.com nc pp-d1-gritz.pp.internal.com 22 2> /dev/null"
debug3: spawning ssh proxy.internal.pp.com nc pp-d1-gritz.pp.internal.com 22 2> /dev/null
debug3: w32_getpeername ERROR: not sock :2
debug3: Failed to open file:C:/Users/peter/.ssh/mykey.pub error:2
debug1: identity file C:\\Users\\peter\\.ssh\\mykey type -1
debug3: Failed to open file:C:/Users/peter/.ssh/mykey-cert error:2
debug3: Failed to open file:C:/Users/peter/.ssh/mykey-cert.pub error:2
debug1: identity file C:\\Users\\peter\\.ssh\\mykey-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_for_Windows_8.1
Enter one-time-scratch code:
The code is the proxy prompt (which I don't want as rule 1 should be applied). What have I been doing wrong?
cheers, pete