I have weird case where I'm being told my IT to use the port inside the ssh URL to connect to a git server. My original ssh config is the following:
Host my-host-alias
HostName redacted.redacted.edu
Port 2222
User git
IdentityFile ~/.ssh/my-ssh-private-key
and I was using the git remote url ssh://git@my-host-alias/path/to/repo.git
. I was getting some weird Auth errors with that config (though basic functionality was still working) so IT instructed me to use the git remote url ssh://git@redacted.redacted.edu:2222/path/to/repo.git
and that appeared to work with a manually specified GIT_SSH_COMMAND='ssh -i ~/.ssh/my-private-ssh-key
. So I reconfigured my .ssh/config as follows:
Host redacted.redacted.edu:2222
IdentityFile ~/.ssh/my-ssh-private-key
Suddenly, it seems as if ssh can't parse the Host entry anymore. If I run ssh -Tvvv ssh://git@redacted.redacted.edu
I get the following output (snippet):
debug1: /Users/myuser/.ssh/config line 94: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 48: Applying options for *
debug1: /etc/ssh/ssh_config line 52: Applying options for *
It appears that specifying a Host with a port in the URL breaks the parsing of .ssh/config. Can someone verify this?