使用gcloud计算ssh-接收";主机的真实性..可以'不能成立";警告



我很难在GCP上设置ssh密钥。出于某种原因,我将ssh密钥部署到的目标VM,GCP无法建立主机的真实性,这反过来又不允许我通过ssh密钥对VM进行ssh。(出于显而易见的原因,我编辑了一些信息(

我在GCP上设置了两个虚拟机:

  • 艺术家wrk-linux
  • cuebot

他们都使用相同的用户帐户。

为了设置ssh密钥,我使用以下gcloud命令:

关于艺术家wrk-linux:

gcloud compute ssh cuebot --zone us-central1-a

其结果是:

WARNING: The private SSH key file for gcloud does not exist.  
WARNING: The public SSH key file for gcloud does not exist.  
WARNING: You do not have an SSH key for gcloud.  
WARNING: SSH keygen will be executed to generate a key.  
Generating public/private rsa key pair.  
Enter passphrase (empty for no passphrase):   
Enter same passphrase again:  
Your identification has been saved in /home/mario/.ssh/google_compute_engine.  
Your public key has been saved in /home/mario/.ssh/google_compute_engine.pub. 
Updating project ssh metadata...
Updated ...
Updating project ssh metadata...done.                                 
Waiting for SSH key to propagate. Warning: Permanently added 'compute.1240479947027764538' 
(ED25519) to the list of known hosts.

我可以在cuebot(目标(VM中看到一个新创建的~/.ssh/autored_keys文件。

而且,我现在已经ssh进入cuebot虚拟机了。

作为一个健全性检查,我退出ssh会话并执行:

ssh -T mario@ip.address.of.cuebot

这将导致以下警告消息:

The authenticity of host 'ip.address.of.cuebot' (ip.address.of.cuebot)' can't be established.
ED25519 key fingerprint is SHA256:cM....
ED25519 key fingerprint is MD5:94:56....
Are you sure you want to continue connecting (yes/no)?

当我说是的时候,我看到的是:

Warning: Permanently added 'ip.address.of.cuebot' (ED25519) to the list of known hosts.
**Permission denied (publickey).**

你知道我做错了什么吗?

谢谢!

我是GCP的新手,对ssh了解不多,但我得到的是:

CCD_ 1是CCD_ 2的包装器。您可以通过使用--dry-run标志来查看它的作用。

例如:

$ gcloud compute ssh myinstance1 --dry-run
/usr/bin/ssh -t -i /home/ana/.ssh/google_compute_engine -o CheckHostIP=no -o HostKeyAlias=compute.3772111379863307723 -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/home/ana/.ssh/google_compute_known_hosts ana@1.2.3.4

因此,您之所以会出现错误,是因为您没有告诉ssh命令使用自定义私钥google_compute_engine和其他选项。

相关内容

最新更新