configure gogs server with ssh

3.4k Views Asked by At

I have gogs installed and I can clone my repos with http link in sourcetree, but now I´m trying to integrate with jenkins. The problem is I get a message: port 22 rejected so I tried to directly clone my repo from the server with jenkins through git bash. And still port 22 rejected. Please someone could tell me how to deal with gogs and ssh, so finally I can integrate it with jenkins properly?

2

There are 2 best solutions below

5
On

According to the default gogs configuration file, serving repositories over SSH (port 22) is not enabled by default. Therefore any attempts to connect to this port would be rejected.

Make sure you enable the relevant settings, and test that you can clone via SSH from your computer before trying with Jenkins.

0
On

If the gogs process is ran by a user who is not part of the sudo group then the script won't be able to listen on ports below 1024. Set it to something above (e.g. 2222) and it should work.