GitLab remote repository with a non standard port

I have the following error:

ssh: connect to host port 22: Connection refused
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Now, the configuration I have in my local .ssh/config file is:

  • Git pushing to non-bare repo, save current worktree
  • git bash: Can't spawn kdiff3 as difftool
  • remote git repo cannot be auto checkout after a merge hook
  • Git ignore does not properly ignore directories or files
  • Managing multiple projects with git which are build up on each other and can been used independent
  • Getting code from my forked repository
  • host limeworks
        user git
        port 6565

    and in the remote gitlab.yml:

        ## Web server settings
        port: 6565

    Also, here’s the nginx setup (/sites-enabled/gitlab):

    server {
      listen 80;         # e.g., listen; In most cases *:80 is a good idea
      server_name;     # e.g., server_name;

    I have restarted the gitlab and nginx services after each modification, yet nothing works!

    Edit: Also worth noting here are some snippets from sshd_config of the remote server

    Port 9595
    AllowUsers rrw git

  • git submodule merge conflict: how to visualize?
  • Prefabs & scripts missing after using source control to move Unity project to a different machine
  • How can I preserve line endings when I check out a single file to a different location with git?
  • Specific git branches for aws elastic beanstalk environments
  • Python script to determine if a directory is a git repository
  • Which is more suitable on Windows, git or mercurial?
  • 2 Solutions collect form web for “GitLab remote repository with a non standard port”

    Ok , found the fix:

    • in gitlab.yml … under advanced setting there’s an option to change the default ssh port
    # If you use non-standard ssh port you need to specify it
    • save and restart service

    Make sure to have the consistency @VonC mentioned

    You need to check that this work:

    ssh -vvvT limeworks

    A good debug option is to launch a debug session of your ssh daemon (sshd -d) and see what an ssh command from the client side triggers on the server side.

    I suppose your sshd_config should list the right port on which you expect ssh to listen to: 6595 instead of 9595. Check the doc on /etc/ssh/sshd_config.

    Git Baby is a git and github fan, let's start git clone.