具有非标准端口的 GitLab 远程存储库

标签 git ssh nginx gitlab

我有以下错误:

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.

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

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

在远程 gitlab.yml 中:

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

此外,这是 nginx 设置 (/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;
...

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

编辑:这里还值得注意的是远程服务器的 sshd_config 中的一些片段

Port 9595
AllowUsers rrw git

最佳答案

好的,找到修复方法:

  • 在 gitlab.yml 中...在高级设置下有一个选项可以更改默认的 ssh 端口
# If you use non-standard ssh port you need to specify it
ssh_port:9595
  • 保存并重启服务

确保具有@VonC 提到的一致性

关于具有非标准端口的 GitLab 远程存储库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17774324/

相关文章:

ssh - 如何将文件配置程序与 google_compute_instance_template 结合使用?

caching - 使用 Nginx 强制缓存文件

Git - 如何只包含整个工作树中的某些文件和目录?

git - 在 Git 中将 UCS-2 文件追溯转换为 UTF-8

linux - 如何在linux中杀死未被杀死的进程

node.js - 如何使用 Node.js 建立 SSH 连接

node.js - 502 Bad Gateway - Ubuntu 16.04.2 LTS 上的 Meteor 和 nginx

docker - 在子路径上带有nginx的piwik docker镜像

java - 当我从 git 中提取代码时必须删除并重新添加我的服务器

git - 如何导入导出docker compose?