在询问主机真实性后,SSH将无法连接

use*_*968 6 ssh

我遇到了问题; git返回此警报:

The authenticity of host 'bitbucket.org (104.192.143.2)' can't be established.
RSA key fingerprint is SHA256:zzXQOXSRBEiUtuE8AikJYKwbHaxvSc0ojez9YXaGp1
Are you sure you want to continue connecting (yes/no)?
Run Code Online (Sandbox Code Playgroud)

当我选择是时,它会返回:

Warning: Permanently added 'bitbucket.org,104.192.143.2' (RSA) to the list of known hosts.
ssh_packet_read: Connection closed
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Run Code Online (Sandbox Code Playgroud)

问题是什么?

我必须在哪里添加RSA号码?拜托,我很绝望.:(

Sch*_*ern 8

无法建立主机'bitbucket.org(104.192.143.2)'的真实性.RSA密钥指纹为SHA256:zzXQOXSRBEiUtuE8AikJYKwbHaxvSc0ojez9YXaGp1您确定要继续连接(是/否)吗?

这是正常的,说是的是安全的.要求你确认,ssh过于偏执.您可以在ssh配置中设置StrictHostKeyChecking为关闭它no.

记住您连接的每个服务器的公钥是ssh的安全功能,以保护您免受中间人攻击.它是这样的:

第一次你向主机ssh它的公钥(就是那些SHA256:zzXQ...东西)被记住,通常在~/.ssh/known_hosts.

此后每次ssh都会检查同一主机是否仍在使用相同的密钥.这证实了bitbucket.org仍然是您第一次与之交谈的服务器.

如果键不匹配则可能意味着两件事之一.首先是服务器管理员重新安装了他们的ssh服务器,忘了保持相同的密钥.这对于小型网站来说很常见,但对于像bitbucket.org这样的东西却不太可能.

第二种可能性是ssh服务器已被劫持.不管怎么样.一种常见的方法是流氓DNS服务器返回自己的恶意IP地址而不是bitbucket.org的真实地址.常见的公共wifi连接.


至于为什么它在确认后不会连接,它就在错误信息中.

$ git clone git@bitbucket.org:RobeJablonski/sda-robert.git
Cloning into 'sda-robert'...
conq: repository access denied.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Run Code Online (Sandbox Code Playgroud)

存储库存在,可以验证,因此您没有访问权限(我也没有).Bitbucket确定您使用ssh密钥的人.这意味着您没有使用正确的密钥登录.它必须与您在BitBucket上的帐户相关联的密钥相同.

您可以在https://bitbucket.org/account/user//ssh-keys/下的Bitbucket设置中找到您的BitBucket ssh密钥.然后你必须检查ssh是否正在使用该密钥.您可以使用它来检查它的使用情况ssh -v git@bitbucket.org.它会喷出很多东西,但你正在寻找最后一个实例debug1: Offering RSA public key: /Users/blah/.ssh/blah.

一旦找到,检查/Users/blah/.ssh/blah.pubBitBucket认为你的ssh密钥是否匹配.如果它们不匹配,那么您必须找到匹配的密钥并配置ssh以将该密钥用于bitbucket.org.

如果丢失了密钥,则应在bitbucket.org上更改ssh密钥.


Kum*_*nan 5

确保您在应用程序服务器中遵循以下步骤:

您是否创建了公钥:

cd ~/.ssh/
Run Code Online (Sandbox Code Playgroud)

生成密钥生成:

ssh-keygen
Run Code Online (Sandbox Code Playgroud)

复制公钥值(非私钥)

cat ~/.ssh/id_rsa.pub
Run Code Online (Sandbox Code Playgroud)

安装 git :

sudo apt install git
Run Code Online (Sandbox Code Playgroud)

阿特拉斯设置:

SETTINGS -> Access keys -> Add key

https://bitbucket.org/compassitesinc/your-repository/admin/access-keys/
Run Code Online (Sandbox Code Playgroud)

确保您的电子邮件地址添加到用户组(具有管理员权限)

SETTINGS -> User and group access
Run Code Online (Sandbox Code Playgroud)

添加具有管理员访问权限的电子邮件地址

在您的应用程序根目录中克隆您的存储库。

cd /var/www/html/

git clone git@bitbucket.org:organization_name/repo_application.git repo_application
Run Code Online (Sandbox Code Playgroud)