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

时间:2013-07-21 16:17:10

标签: 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

2 个答案:

答案 0 :(得分:4)

好的,找到了修复:

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

确保提及@VonC的一致性

答案 1 :(得分:2)

您需要检查这项工作:

ssh -vvvT limeworks

一个好的调试选项是启动ssh守护程序(sshd -d)的调试会话,并查看客户端的ssh命令在服务器端触发的内容。

我想你的sshd_config应该列出你希望ssh听的正确端口:6595而不是9595.检查doc on /etc/ssh/sshd_config

相关问题