gpt4 book ai didi

linux - 亚搏体育appGitLab的密码

转载 作者:太空宇宙 更新时间:2023-11-04 04:00:25 33 4
gpt4 key购买 nike

我已经按照 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 key 的说明。我跟着他们,首先在服务器上添加了我的普通用户主页的 key 。不用找了。然后尝试登录 root,并添加 git home 的 key 。仍然没有,但我认为客户端已经拥有我的普通用户 key ,因此不会提取新的 git key 。

编辑。请确认我应该将这些 key 添加到 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 ~]$

最佳答案

似乎是 SELinux 权限问题。遵循的步骤:

  1. restorecon -R -v/home/git/.ssh
  2. usermod -s/bin/bash git
  3. 将您的家庭计算机用户的 .ssh/config 编辑为如下内容:
Host mysite.com
User gitlab_username
Hostname mysite.com
PreferredAuthentications publickey
IdentityFile /home/user/.ssh/id_rsa

尝试连接到 gitlab 服务器ssh -T git@mysite.com。您应该会看到一条欢迎您的消息。

我将其添加到安装指南中。我有一个merge request准备好进行多项增强功能。当gitlab 6.8发布时我会 merge 它。

关于linux - 亚搏体育appGitLab的密码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23202963/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com