SOLVED Unable to pull/push repo over SSH
I set-up my Gogs app and have choose port (:1024) for SSH but when I'm pulling, pushing from my Gogs server SoftRetic: GitRepo, I'm getting an error
git clone ssh://firstname.lastname@example.org:1024/arshsahzad/OnePage.git Cloning into 'OnePage'... ssh: connect to host git.softretic.com port 1024: Connection timed out fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
I think there is problem in app.ini default config of Clodron Gogs
Can you please tell me what is problem, why SSH is not working?? Is it working at your end??
Doesn't work for me as well.
$ telnet git.softretic.com 1024 Trying 220.127.116.11...
This seems like a firewall issue since I am not able to connect at all. Is there a Cloud firewall in the front of this server? Where is this server hosted?
Ah, I saw this screenshot you sent.
@theoaric You also need to add port
1024to this. This is the port where the ssh of gogs is running.
This post is deleted!
I have added port 1024 in the Inbound rules, rebooted server but same problem is still occuring
D:\> git clone ssh://email@example.com:1024/arshsahzad/arshsahzad.git Cloning into 'arshsahzad'... ssh: connect to host git.softretic.com port 1024: Connection timed out fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
arsh@Arsh-Sahzad:~$ telnet git.softretic.com 22 Trying 18.104.22.168... Trying 22.214.171.124... Trying 126.96.36.199... Trying 2606:4700:8d9e:a5c4:2cd7:25:dc53:65b9... telnet: Unable to connect to remote host: Network is unreachable arsh@Arsh-Sahzad:~$ telnet git.softretic.com 1024 Trying 188.8.131.52... Trying 184.108.40.206... Trying 220.127.116.11... Trying 2606:4700:8d9e:a5c4:2cd7:5f:dc53:65b9... telnet: Unable to connect to remote host: Network is unreachable
@theoaric Looks like you have enabled Cloudflare proxying for the domain. Go to cloudron dashboard and disable it for
Cloudflare will only proxy http and https. It won't proxy ssh, git and other ports.
Now it's working fine but for that, I have to disable all proxy on cloudflare for same server IP address, disabling proxy only on
gitsubdomain, same problem is still occuring. btw thanks for your wonderful help
That shouldn't be the case. You only have to disable proxying for
git. Maybe it was just some DNS caching issue. What you can do is to check the output of
git.softretic.comand see if it points to your server's IP (it should be a single IP). If it has multiple IP addresses (like the output you pasted above of telnet command), it means that it's still using Cloudflare's servers. So, you have to wait for some time for the DNS to update.
arsh@Arsh-Sahzad:~$ telnet git.softretic.com Trying 18.104.22.168... telnet: Unable to connect to remote host: Connection timed out arsh@Arsh-Sahzad:~$ telnet git.softretic.com 1024 Trying 22.214.171.124... Connected to git.softretic.com. Escape character is '^]'. SSH-2.0-OpenSSH_7.6p1 Ubuntu-4ubuntu0.3
- Disabling proxy on git.softretic.com subdomain is now working fine
This post is deleted!
@theoaric It seems to be working as expected.
The first command without any third argument will default to port "22" (which is the telnet port). This won't work as there is nothing on port 22. The second one connected to 1024, which does work since gogs is listening there.
FWIW, I can connect fine now from my laptop to your gogs.
Thanks, now I understand