自定义 SSH 端口上的 Gitlab
Posted
技术标签:
【中文标题】自定义 SSH 端口上的 Gitlab【英文标题】:Gitlab on Custom SSH Port 【发布时间】:2012-09-30 22:11:48 【问题描述】:我尝试安装 Gitlab,但无法输入自定义 SSH 端口。
已经将 gitlab.yml 中的端口设置为我的自定义端口,并创建了文件
/home/gitlab/gitlab/.ssh/config
用我的属性:
Host localhost
Port 100001
如here 所述。
但在测试时仍然显示以下消息:
bundle exec rake gitlab:app:status RAILS_ENV=production
Starting diagnostic
config/database.yml............exists
config/gitlab.yml............exists
/home/git/repositories/............exists
/home/git/repositories/ is writable?............YES
ssh: connect to host localhost port 22: Connection refused
fatal: The remote end hung up unexpectedly
Can clone gitolite-admin?............YES
UMASK for .gitolite.rc is 0007? ............YES
/home/git/.gitolite/hooks/common/post-receive exists? ............YES
Finished
我无法在 Gitlab 中添加我的公共 ssh 密钥,它显示“GitLab 无法访问您的 Gitolite 系统。”
谁能帮忙?
【问题讨论】:
【参考方案1】:你至少有两个问题。
配置文件的正确路径是/home/gitlab/.ssh/config
您不能使用端口 100001,因为它不存在。端口范围从 1 到 65535,我建议您使用 9000 以上的端口。
【讨论】:
/home/gitlab/.ssh/config 存在,并使用“localhost”作为主机,我正确的 ssh 端口作为“端口”。我只是不想在这里发布我的端口。谢谢,但问题仍然存在.. 尝试检查您是否真的正确设置了 ssh。成为 gitlab 用户(可能是 [# sudo su -s /bin/bash gitlab])并检查您的 ssh 配置是否有效:[# ssh git@localhost]。如果你连接到 gitolite,你的 .ssh/config 一切都很好,问题出在 gitlab。以上是关于自定义 SSH 端口上的 Gitlab的主要内容,如果未能解决你的问题,请参考以下文章