Pierrick Rambaud
Pierrick Rambaud

Reputation: 2434

How to use port 443 in ADO for SSH key authentication

I'm using Azure DevOps in my company and I would like to connect to the git repositories using ssh. I followed the instruction from the official documentation. and

I'm stuck with the following error:

ssh: connect to host vs-ssh.visualstudio.com port 22: Connection timed out

It seems the port 22 is closed and the security team will not open it. For github stored repositories I found the perfect solution and I simply redirect the git user to port 443 that is open:

Host github.com
    Hostname ssh.github.com
    Port 443
    User git

It works perfectly so I tried to adapt it to my use case:

Host vs-ssh.visualstudio.com
    Hostname vs-ssh.visualstudio.com
    Port 443
    User <my-company>

And now I got the following error:

kex_exchange_identification: read: Connection reset by peer

Did I make a mistake? Is it even possible?

Upvotes: 0

Views: 65

Answers (1)

Jim Redmond
Jim Redmond

Reputation: 5660

That hostname (vs-ssh.visualstudio.com) is listening for SSH traffic on port 22, and serving HTTPS from port 443 (the usual port for HTTPS). If you don't manage that host, then you can only connect to its SSH daemon using the ports that they've configured for SSH. If you do manage that host, then you'll need to change its SSH daemon configuration to listen on another port that isn't already in use; the details here will depend on which SSH daemon you have running there.

In a more general sense, you can have an SSH daemon listen on any (unused) ports you want, but you'll have to configure it to listen on those ports, and you'll have to tell client systems to use one of those ports. GitHub has done that for ssh.github.com:443 - their load balancers associate traffic to that hostname and port with their SSH backend - but they've explicitly configured it that way.

Upvotes: 1

Related Questions