Google app engine 无法SSH到Google云
我安装了谷歌云SDK 我以为我创建了一个新实例。我不了解宋承宪。我按照这里描述的步骤进行操作: 我有Windows7操作系统 我检查了此处建议的防火墙规则: 我通过Web UI检查了这些,并找到了规则Google app engine 无法SSH到Google云,google-app-engine,ssh,ssh-keys,gcloud,Google App Engine,Ssh,Ssh Keys,Gcloud,我安装了谷歌云SDK 我以为我创建了一个新实例。我不了解宋承宪。我按照这里描述的步骤进行操作: 我有Windows7操作系统 我检查了此处建议的防火墙规则: 我通过Web UI检查了这些,并找到了规则 "default-allow-ssh 0.0.0.0/0 tcp:22 Apply to all targets" 我采取了以下步骤: 1) >gcloud身份验证登录 (默认浏览器打开,我授权Google Cloud SDK) Google SDK外壳输出: "Saved Applic
"default-allow-ssh 0.0.0.0/0 tcp:22 Apply to all targets"
我采取了以下步骤:
1) >gcloud身份验证登录
(默认浏览器打开,我授权Google Cloud SDK)
Google SDK外壳输出:
"Saved Application Credentails. You are now logged as [someuser@gmail]
Your current project is [some-project-999].
WARNING: You do not have an SSH key for Google Compute Engine.
WARNING: [C:\Program Files\Google\Cloud SDK\google-cloud-sdk\bin\..\bin\sdk\ssh-keygen.EXE] will be executed to generate
a key.
Generating public/private rsa key pair.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
The key fingerprint is:
ssh-rsa 2048 06:73:ac:e8:f2:31:c8:df:d4:b0:a2:3b:a2:53:6c:09
Your private key has been saved in C:\Users\First Last\.ssh\google_compute_engine.
Your public key has been saved in C:\Users\First Last\.ssh\google_compute_engine.pub.
Your putty key has been saved in C:\Users\First Last\.ssh\google_compute_engine.ppk.
Updated [https://www.googleapis.com/compute/v1/projects/arctic-depth-863].
Server refused our key
FATAL ERROR: Disconnected: No supported authentication methods available (server sent: publickey)
Server refused our key
FATAL ERROR: Disconnected: No supported authentication methods available (server sent: publickey)
Server refused our key
FATAL ERROR: Disconnected: No supported authentication methods available (server sent: publickey)
FATAL ERROR: Network error: Software caused connection abort
FATAL ERROR: Network error: Connection timed out
ERROR: (gcloud.compute.ssh) Could not SSH to the instance. It is possible that your SSH key has not propagated to the i
nstance yet. Try running this command again. If you still cannot connect, verify that the firewall and instance are set
to accept ssh traffic.
2) >gcloud compute ssh my instance--zone us-central1-a
Google SDK外壳输出:
"Saved Application Credentails. You are now logged as [someuser@gmail]
Your current project is [some-project-999].
WARNING: You do not have an SSH key for Google Compute Engine.
WARNING: [C:\Program Files\Google\Cloud SDK\google-cloud-sdk\bin\..\bin\sdk\ssh-keygen.EXE] will be executed to generate
a key.
Generating public/private rsa key pair.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
The key fingerprint is:
ssh-rsa 2048 06:73:ac:e8:f2:31:c8:df:d4:b0:a2:3b:a2:53:6c:09
Your private key has been saved in C:\Users\First Last\.ssh\google_compute_engine.
Your public key has been saved in C:\Users\First Last\.ssh\google_compute_engine.pub.
Your putty key has been saved in C:\Users\First Last\.ssh\google_compute_engine.ppk.
Updated [https://www.googleapis.com/compute/v1/projects/arctic-depth-863].
Server refused our key
FATAL ERROR: Disconnected: No supported authentication methods available (server sent: publickey)
Server refused our key
FATAL ERROR: Disconnected: No supported authentication methods available (server sent: publickey)
Server refused our key
FATAL ERROR: Disconnected: No supported authentication methods available (server sent: publickey)
FATAL ERROR: Network error: Software caused connection abort
FATAL ERROR: Network error: Connection timed out
ERROR: (gcloud.compute.ssh) Could not SSH to the instance. It is possible that your SSH key has not propagated to the i
nstance yet. Try running this command again. If you still cannot connect, verify that the firewall and instance are set
to accept ssh traffic.
在浏览器的Web UI上,我打开Broser的SSH并导航到.SSH文件夹
someuser_gmail_com@my-instance:~$ cd .ssh
someuser_gmail_com@my-instance:~$ cat authorized_keys
# Added by Google
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC4OxYxWvIlp...F7As google-ssh {"userName":"someuser@gmail.com","expireOn":"2015-02-21T23:29:06+0000"}
# Added by Google
ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzd...KRqcUZmvWr= google-ssh {"userName":"someuser@gmail.com","expireOn":"2015-02-21T23:28:55+0000"}
在WebUI上,我导航到项目的>计算>计算引擎>元数据>SSH密钥,并看到三条记录
用户名密钥
- 一些用户“\u gmail\u com ssh rsa aaaab3nzac1yc2eaaaaadaqaabaabaqc4…”,“edpireOn”:“2015-02-21T23:29:06+0000”}
- 一些用户“gmail”com ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTIt…,“edpireOn”:“2015-02-21T23:29:06+0000”
- 最后一个ssh rsa aaaab3nzac1yc2eaaabjqaaqaei…ZkpSpRt6RQ==第一个Last@MYPC
ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAit...mGhUKZRgFZkpSpRt6RQ== First Last@MYPC
问题:
- 用户文件夹路径中的空白是否会导致问题(即“First-Last”)
- 当googlecloudsdk创建密钥时,它会将注释设置为FirstLast@MYPC. 这是正确的设置吗?(我一直在阅读和尝试这个和那个,我怀疑应该是这样的someuser@my-实例(公共IP)
canIpForward: false
creationTimestamp: '2015-02-21T14:53:37.276-08:00'
disks:
- autoDelete: true
boot: true
deviceName: my-instance
index: 0
interface: SCSI
kind: compute#attachedDisk
licenses:
- https://www.googleapis.com/compute/v1/projects/ubuntu-os-cloud/global/licenses/ubuntu-1204-precise
mode: READ_WRITE
source: https://www.googleapis.com/compute/v1/projects/some-project-999/zones/us-central1-a/disks/my-instance
type: PERSISTENT
id: '111812933445597333'
kind: compute#instance
machineType: https://www.googleapis.com/compute/v1/projects/some-project-999/zones/us-central1-a/machineTypes/g1-small
metadata:
fingerprint: w3steEkuQUS=
kind: compute#metadata
name: my-instance
networkInterfaces:
- accessConfigs:
- kind: compute#accessConfig
name: External NAT
natIP: 112.134.99.170
type: ONE_TO_ONE_NAT
name: nic0
network: https://www.googleapis.com/compute/v1/projects/some-project-999/global/networks/default
networkIP: 10.356.252.66
scheduling:
automaticRestart: true
onHostMaintenance: MIGRATE
selfLink: https://www.googleapis.com/compute/v1/projects/some-project-999/zones/us-central1-a/instances/my-instance
serviceAccounts:
- email: 78111222333-compute@developer.gserviceaccount.com
scopes:
- https://www.googleapis.com/auth/devstorage.read_only
- https://www.googleapis.com/auth/logging.write
status: RUNNING
tags:
fingerprint: DLYFgkKTlB3=
items:
- http-server
zone: https://www.googleapis.com/compute/v1/projects/some-project-999/zones/us-central1-a
C:\Program Files\Google\Cloud SDK>
从Windows使用云SDK时,这是一个已知问题 请在[1]下载pageant.exe,并使用它加载ppk密钥,或使用Putty(可从同一链接下载)将SSH下载到实例,如[2]中所述 作为一种解决方法,您甚至可以在C:\Program Files\Google\Cloud SDK\Google Cloud SDK\bin\SDK\中将ssh.exe重命名为ssh-bak.exe,将ssh-term.exe重命名为ssh.exe 链接:
[1] -
[2] -能否尝试使用不带空格的其他用户使用gcloud ssh命令ssh到实例?SDK创建的密钥(username@hostname)是正确的。“这是从Windows使用云SDK时的已知问题”由谁知道?如果我不清楚,很抱歉。GCE工程师意识到了这个问题,并且存在一个内部缺陷。目前还没有解决这个问题的预计时间。