【发布时间】:2016-02-03 06:35:20
【问题描述】:
我已经按照https://github.com/gitlabhq/gitlab-recipes/tree/master/install/centos 安装了 GitLab。
添加用户“git”的指令状态
adduser --system --shell /sbin/nologin --comment 'GitLab' --create-home --home-dir /home/git/ git
似乎一切正常。然后我在 GitLab 服务器上添加了一个项目,它给出了推送的说明:
cd existing_git_repo
git remote add origin git@mysite.com:root/bidjunction.git
git push -u origin master
然后我去我的客户端推送到 git 服务器。
[Michael@devserver bidjunction]$ git push -u origin master
The authenticity of host 'mysite.com (123.456.789.01)' can't be established.
RSA key fingerprint is cd:32:3c:5a:4e:33:44:11:df:ee:3s:4b:3a:c2:a4:c2.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'mysite.com,123.456.789.01' (RSA) to the list of known hosts.
Address 123.456.789.01 maps to ve6.phpwebhosting.com, but this does not map back to the address - POSSIBLE BREAK-IN ATTEMPT!
git@mysite.com's password:
有我应该设置的密码吗?可能不是,并且说明没有解决。
阅读System ask password when push project to github,看来它可能与SSH有关。
GitLab 提供以下说明来添加 SSH 密钥。我跟着他们,首先在服务器上添加了我普通用户家的密钥。没变。然后尝试登录root,并在git的主页上添加了一个密钥。仍然没有,但我认为客户端已经拥有我的一般用户的密钥,因此没有拉新的 git 密钥。
编辑。请确认我应该将这些密钥添加到 GitLab 服务器,而不是我的 Linux 客户端。
我们将不胜感激。
SSH Keys
SSH key allows you to establish a secure connection between your computer and GitLab
Before generating an SSH key, check if your system already has one by running cat ~/.ssh/id_rsa.pub If your see a long string starting with ssh-rsa or ssh-dsa, you can skip the ssh-keygen step.
To generate a new SSH key just open your terminal and use code below. The ssh-keygen command prompts you for a location and filename to store the key pair and for a password. When prompted for the location and filename you can press enter to use the default. It is a best practice to use a password for an SSH key but it is not required and you can skip creating a password by pressing enter. Note that the password you choose here can't be altered or retrieved.
ssh-keygen -t rsa -C "$your_email"
Use the code below to show your public key.
cat ~/.ssh/id_rsa.pub
Copy-paste the key to the 'My SSH Keys' section under the 'SSH' tab in your user profile. Please copy the complete key starting with ssh- and ending with your username and host.
编辑 2
看起来我很困惑,并使用了 GitLab 的服务器 id_rsa.pub。估计没有任何意义!我已经更正了它,但现在我收到了这个错误:
[Michael@devserver ~]$ ssh git@mysite.com
Address 123.456.789.01 maps to ve6.phpwebhosting.com, but this does not map back to the address - POSSIBLE BREAK-IN ATTEMPT!
PTY allocation request failed on channel 0
This account is currently not available.
Connection to mysite.com closed.
[Michael@devserver ~]$
【问题讨论】: