Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


SOLVED Unable to pull/push repo over SSH



  • SSH Problem

    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

    Error

    git clone ssh://git@git.softretic.com: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

    Cloudron Gogs default app.ini

    Can you please tell me what is problem, why SSH is not working?? Is it working at your end??


  • Staff

    @theoaric said in Unable to pull/push repo over SSH:

    git.softretic.com:1024

    Doesn't work for me as well.

    $ telnet git.softretic.com 1024
    Trying 104.27.179.112...
    

    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?


  • Staff

    Ah, I saw this screenshot you sent.

    8a981ef4-ddd7-42c3-afc8-09bf6ff09187-image.png

    @theoaric You also need to add port 1024 to 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://git@git.softretic.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.
    

    1.JPG
    2.JPG

    arsh@Arsh-Sahzad:~$ telnet git.softretic.com 22
    Trying 104.27.178.112...
    Trying 104.27.179.112...
    Trying 172.67.145.176...
    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 172.67.145.176...
    Trying 104.27.179.112...
    Trying 104.27.178.112...
    Trying 2606:4700:8d9e:a5c4:2cd7:5f:dc53:65b9...
    telnet: Unable to connect to remote host: Network is unreachable
    

  • Staff

    @theoaric Looks like you have enabled Cloudflare proxying for the domain. Go to cloudron dashboard and disable it for git subdomain.

    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 git subdomain, same problem is still occuring. btw thanks for your wonderful help

    Screenshot 2020-09-30 045020.png


  • Staff

    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.com and 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 54.210.194.22...
    telnet: Unable to connect to remote host: Connection timed out
    arsh@Arsh-Sahzad:~$ telnet git.softretic.com 1024
    Trying 54.210.194.22...
    Connected to git.softretic.com.
    Escape character is '^]'.
    SSH-2.0-OpenSSH_7.6p1 Ubuntu-4ubuntu0.3
    


  • This post is deleted!

  • Staff

    @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