根据Google Cloud 文档,如果我是具有“计算实例管理员”角色的项目成员,我应该能够使用 gcloud 工具连接到项目中的任何实例。
在 Google Cloud 控制台的项目 IAM 页面上,我已明确添加具有“计算实例管理员 (v1)”角色的用户名,但我仍然无法连接到由我们的某些自动化功能创建的实例。
[username]:~/src/infrastructure$ gcloud compute ssh [instance id]
Unauthorized use is strictly prohibited. All access and activity
is subject to logging and monitoring.
Permission denied (publickey).
ERROR: (gcloud.compute.ssh) [/usr/bin/ssh] exited with return code [255].
Run Code Online (Sandbox Code Playgroud)
我似乎能够连接到的唯一实例是我创建的实例。
这里可能出了什么问题?
附带说明一下,根据此文档,我应该能够手动将 RSA 公钥添加到实例,然后使用 SSH 进行连接。
我将公钥添加~/.ssh/google_compute_engine.pub到实例元数据中,然后尝试使用 SSH,但没有成功。
[username]:~/src/infrastructure$ ssh -i ~/.ssh/google_compute_engine [public ip of instance]
Unauthorized use is strictly prohibited. All access and activity is subject to logging …Run Code Online (Sandbox Code Playgroud) 我正在关注Heroku的"在Heroku上开始使用Django"一文,并且在"pip install psycopg2"上遇到了一系列错误.已经安装了Django 1.4.3和PostgreSQL 9.2.2,是的,postgres\bin \目录在PATH上.

有任何想法吗?
我们正在尝试使用 Python SDK (v2.0) 和当前用户的 CLI 凭据创建 Azure 应用程序注册。
from azure.common.credentials import get_azure_cli_credentials
from azure.graphrbac import GraphRbacManagementClient
credentials, subscription_id = get_azure_cli_credentials()
client = GraphRbacManagementClient(credentials, 'my-tenant-id')
app_parameters = {
'available_to_other_tenants': False,
'display_name': 'my-app-name',
'identifier_uris': ['http://my-app-name.com']
}
app = client.applications.create(app_parameters)
Run Code Online (Sandbox Code Playgroud)
但这返回
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/my-app-code/.venv/lib/python3.6/site-packages/azure/graphrbac/operations/applications_operations.py", line 86, in create
raise models.GraphErrorException(self._deserialize, response)
azure.graphrbac.models.graph_error.GraphErrorException: Access Token missing or malformed.
Run Code Online (Sandbox Code Playgroud)
我们注意到我们可以ServicePrincipalCredentials通过resource='https://graph.windows.net'在构造函数中包含来避免这个错误,但是在使用get_azure_cli_credentials().
我们做错了什么,还是应该这样做?
请不要回复我们应该使用ServicePrincipalCredentials. 我们的用例明确指出交互式用户可以使用 Python SDK 创建/注册 …