What firewall port(s) need to be open to allow access to external git repositories?
Asked
Active
Viewed 1.9e+01k times
4 Answers
94
It depends on the repository.
The native git transport uses TCP port 9418. However, git can also run over ssh (often used for pushing), http, https, and less often others.
You can look at the repository URL to find out which port it uses. Notice that many public repositories have several alternate URLs; for instance, the kernel.org repositories have git://
, http://
, and https://
URLs.
The common URL schemes for git repositories are:
ssh://
- default port 22git://
- default port 9418http://
- default port 80https://
- default port 443
If the URL does not have a scheme, it it using ssh with a slightly different syntax.
See the git fetch manpage for more details on the available URL schemes.
CesarB
- 2,368
- 15
- 9
-
3Thank you for the additional ports and justification for each. This is a more complete answer to the question. – Eric Steinborn Jan 30 '17 at 14:48
3
I've also found that the outbound SSH port 22 might need to be open as well as port 9418 for Git (both TCP). Depends on your setup though!
BeesonBison
- 177
- 7