具有非标准端口的 GitLab 远程存储库 [英] GitLab remote repository with a non standard port

查看:13
本文介绍了具有非标准端口的 GitLab 远程存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下错误:

ssh:连接到主机 git.limeworks.eu 端口 22:连接被拒绝致命:无法从远程存储库中读取.请确保您拥有正确的访问权限并且存储库存在.

现在,我在本地 .ssh/config 文件中的配置是:

主机limeworks用户 git端口 6565主机名 git.limeworks.eu;

并在远程 gitlab.yml:

 gitlab:## 网络服务器设置主机:git.limeworks.eu端口:6565

另外,这里是 nginx 设置(/sites-enabled/gitlab):

服务器{听 80;# 例如,听 192.168.1.1:80;在大多数情况下 *:80 是个好主意server_name git.limeworks.eu;# 例如,server_name source.example.com;...

每次修改后我都重启了gitlab和nginx服务,但是没有任何效果!

另外值得注意的是来自远程服务器的 sshd_config 的一些片段

端口 9595AllowUsers rrw git

解决方案

好的,找到解决办法:

  • 在 gitlab.yml ... 在高级设置下有一个更改默认 ssh 端口的选项
<块引用>

#如果使用非标准ssh端口需要指定ssh_port:9595

  • 保存并重启服务

确保提及@VonC 的一致性

I have the following error:

ssh: connect to host git.limeworks.eu 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:

host limeworks
    user git
    port 6565
    hostname git.limeworks.eu;

and in the remote gitlab.yml:

  gitlab:
    ## Web server settings
    host: git.limeworks.eu
    port: 6565

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

server {
  listen 80;         # e.g., listen 192.168.1.1:80; In most cases *:80 is a good idea
  server_name git.limeworks.eu;     # e.g., server_name source.example.com;
...

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

解决方案

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
ssh_port:9595

  • save and restart service

Make sure to have the consistency @VonC mentioned

这篇关于具有非标准端口的 GitLab 远程存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆