【发布时间】:2017-10-31 14:04:03
【问题描述】:
所以我有一个个人 Bitbuket 帐户,我用它来克隆/推送/拉取没有问题。
我正在使用 Git-Bash 并使用 git config --global user.name 和 git config --global user.email 做了一个全局用户名和密码
现在我在 Gitlab 上获得了一个具有不同电子邮件和密码的新帐户,并且我创建了一个新的 SSH 密钥 id_rsa_gitlab 并将该 SSH 密钥 ssh-add ~/.ssh/id_rsa_gitlab 添加到 gitlab.lan 帐户,并将该规则添加到配置文件中...
Host bitbucket.org
IdentityFile ~/.ssh/id_rsa
Host gitlab
HostName gitlab.lan
User git
IdentityFile ~/.ssh/id_rsa_gitlab
但是现在当我尝试从 Gitlab 存储库克隆时,我收到了这个错误...
ssh: connect to host gitlab.lan port 22: Connection timed out
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
我在这里缺少什么?
我需要更改全局 user.name 和 user.password 还是什么?
【问题讨论】:
-
gitlab 是否在 22 端口运行?如果你在控制台上运行
ssh gitlab.lan会发生什么? -
@Ruby:你为什么不改变只是改变存储库的 user.name 和 user.email(不是全局的)并使用相同的 SSH 密钥?
-
@Flurin: 22端口是不是ssh端口?
-
端口 22 通常是 SSH 端口,但大多数本地 git 包会监听其他东西 - 这样服务器管理员仍然可以使用端口 22 进行常规访问。
-
@Flurin 它打印
ssh: connect to host gitlab.lan port 22: Connection timed out
标签: git ssh bitbucket gitlab git-bash