我有以下错误:
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/